<?php

	// TITLE: Database Model
	// FILE: lib/dbio.php
	// AUTHOR: AUTOGEN
	// CREATED: 2015/01/27 08:00:41
	// DESCRIPTION: 
	// REQUIREMENTS: 



	class dbio {

		// ATTRIBUTES /////////////////////////////////////////////////////////////////////////////

		protected $con;

		// CONSTRUCTOR ////////////////////////////////////////////////////////////////////////////

		public function __construct() {}


		// METHODS ////////////////////////////////////////////////////////////////////////////////

		private function open() {
			global $con;
			$hostname = '127.0.0.1';
			$username = 'root';
			$password = '';
			$database = '';
			$con = mysqli_connect($hostname, $username, $password, $database) or die ('no worky');
		}// END

		private function close() {
			global $con;
			mysqli_close($con);
		}// END


		// BUSINESS LOGIC METHODS //////////////////////////////////////////////

		// account // --------------------

		public function createAccount($id, $username, $password, $date, $status, $isAdmin, $isOffice, $isVolunteer, $isDonor, $isHO, $person_id) {
			global $con;
			$sql = 'INSERT INTO account (id, username, password, date, status, isAdmin, isOffice, isVolunteer, isDonor, isHO, person_id) VALUES (' . $id . ', ' . $username . ', ' . $password . ', ' . $date . ', ' . $status . ', ' . $isAdmin . ', ' . $isOffice . ', ' . $isVolunteer . ', ' . $isDonor . ', ' . $isHO . ', ' . $person_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readAccount($id) {
			global $con;
			$sql = 'SELECT * FROM account WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$account = new Account();
				$account->setId($result[0]);
				$account->setUsername($result[1]);
				$account->setPassword($result[2]);
				$account->setDate($result[3]);
				$account->setStatus($result[4]);
				$account->setIsAdmin($result[5]);
				$account->setIsOffice($result[6]);
				$account->setIsVolunteer($result[7]);
				$account->setIsDonor($result[8]);
				$account->setIsHO($result[9]);
				$account->setPerson($this->readPerson($result[10]));
			} else {
				$account = false;
			}
			return $account;
		}// end function

		public function updateAccount($id, $username, $password, $date, $status, $isAdmin, $isOffice, $isVolunteer, $isDonor, $isHO, $person_id) {
			global $con;
			$sql = 'UPDATE account SET username = ' . $username . ', password = ' . $password . ', date = ' . $date . ', status = ' . $status . ', isAdmin = ' . $isAdmin . ', isOffice = ' . $isOffice . ', isVolunteer = ' . $isVolunteer . ', isDonor = ' . $isDonor . ', isHO = ' . $isHO . ', person_id = ' . $person_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteAccount($id) {
			global $con;
			$sql = 'DELETE FROM account WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listAccount() {
			global $con;
			$sql = 'SELECT * FROM account';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$accounts = array();
				while ($result = mysqli_fetch_array($results)) {
					$account = new Account();
					$account->setId($result[0]);
					$account->setUsername($result[1]);
					$account->setPassword($result[2]);
					$account->setDate($result[3]);
					$account->setStatus($result[4]);
					$account->setIsAdmin($result[5]);
					$account->setIsOffice($result[6]);
					$account->setIsVolunteer($result[7]);
					$account->setIsDonor($result[8]);
					$account->setIsHO($result[9]);
					$account->setPerson($this->readPerson($result[10]));
					$accounts[] = $account;
				}// end while
			} else {
				$accounts = false;
			}
			return $accounts;
		}// end function

		// account_recovery // --------------------

		public function createAccount_recovery($account_id, $code, $date, $time, $status) {
			global $con;
			$sql = 'INSERT INTO account_recovery (account_id, code, date, time, status) VALUES (' . $account_id . ', ' . $code . ', ' . $date . ', ' . $time . ', ' . $status . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readAccount_recovery($id) {
			global $con;
			$sql = 'SELECT * FROM account_recovery WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$account_recovery = new Account_recovery();
				$account_recovery->setAccount($this->readAccount($result[0]));
				$account_recovery->setCode($result[1]);
				$account_recovery->setDate($result[2]);
				$account_recovery->setTime($result[3]);
				$account_recovery->setStatus($result[4]);
			} else {
				$account_recovery = false;
			}
			return $account_recovery;
		}// end function

		public function updateAccount_recovery($account_id, $code, $date, $time, $status) {
			global $con;
			$sql = 'UPDATE account_recovery SET account_id = ' . $account_id . ', code = ' . $code . ', date = ' . $date . ', time = ' . $time . ', status = ' . $status . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteAccount_recovery($id) {
			global $con;
			$sql = 'DELETE FROM account_recovery WHERE account_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listAccount_recovery() {
			global $con;
			$sql = 'SELECT * FROM account_recovery';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$account_recoverys = array();
				while ($result = mysqli_fetch_array($results)) {
					$account_recovery = new Account_recovery();
					$account_recovery->setAccount($this->readAccount($result[0]));
					$account_recovery->setCode($result[1]);
					$account_recovery->setDate($result[2]);
					$account_recovery->setTime($result[3]);
					$account_recovery->setStatus($result[4]);
					$account_recoverys[] = $account_recovery;
				}// end while
			} else {
				$account_recoverys = false;
			}
			return $account_recoverys;
		}// end function

		// address // --------------------

		public function createAddress($id, $street1, $street2, $city, $state_id, $zip) {
			global $con;
			$sql = 'INSERT INTO address (id, street1, street2, city, state_id, zip) VALUES (' . $id . ', ' . $street1 . ', ' . $street2 . ', ' . $city . ', ' . $state_id . ', ' . $zip . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readAddress($id) {
			global $con;
			$sql = 'SELECT * FROM address WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$address = new Address();
				$address->setId($result[0]);
				$address->setStreet1($result[1]);
				$address->setStreet2($result[2]);
				$address->setCity($result[3]);
				$address->setState($this->readState($result[4]));
				$address->setZip($result[5]);
			} else {
				$address = false;
			}
			return $address;
		}// end function

		public function updateAddress($id, $street1, $street2, $city, $state_id, $zip) {
			global $con;
			$sql = 'UPDATE address SET street1 = ' . $street1 . ', street2 = ' . $street2 . ', city = ' . $city . ', state_id = ' . $state_id . ', zip = ' . $zip . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteAddress($id) {
			global $con;
			$sql = 'DELETE FROM address WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listAddress() {
			global $con;
			$sql = 'SELECT * FROM address';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$addresss = array();
				while ($result = mysqli_fetch_array($results)) {
					$address = new Address();
					$address->setId($result[0]);
					$address->setStreet1($result[1]);
					$address->setStreet2($result[2]);
					$address->setCity($result[3]);
					$address->setState($this->readState($result[4]));
					$address->setZip($result[5]);
					$addresss[] = $address;
				}// end while
			} else {
				$addresss = false;
			}
			return $addresss;
		}// end function

		// affiliated_with // --------------------

		public function createAffiliated_with($organization_id, $person_id, $phone, $ext, $email) {
			global $con;
			$sql = 'INSERT INTO affiliated_with (organization_id, person_id, phone, ext, email) VALUES (' . $organization_id . ', ' . $person_id . ', ' . $phone . ', ' . $ext . ', ' . $email . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readAffiliated_with($id) {
			global $con;
			$sql = 'SELECT * FROM affiliated_with WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$affiliated_with = new Affiliated_with();
				$affiliated_with->setOrganization($this->readOrganization($result[0]));
				$affiliated_with->setPerson($this->readPerson($result[1]));
				$affiliated_with->setPhone($result[2]);
				$affiliated_with->setExt($result[3]);
				$affiliated_with->setEmail($result[4]);
			} else {
				$affiliated_with = false;
			}
			return $affiliated_with;
		}// end function

		public function updateAffiliated_with($organization_id, $person_id, $phone, $ext, $email) {
			global $con;
			$sql = 'UPDATE affiliated_with SET organization_id = ' . $organization_id . ', person_id = ' . $person_id . ', phone = ' . $phone . ', ext = ' . $ext . ', email = ' . $email . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteAffiliated_with($id) {
			global $con;
			$sql = 'DELETE FROM affiliated_with WHERE organization_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listAffiliated_with() {
			global $con;
			$sql = 'SELECT * FROM affiliated_with';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$affiliated_withs = array();
				while ($result = mysqli_fetch_array($results)) {
					$affiliated_with = new Affiliated_with();
					$affiliated_with->setOrganization($this->readOrganization($result[0]));
					$affiliated_with->setPerson($this->readPerson($result[1]));
					$affiliated_with->setPhone($result[2]);
					$affiliated_with->setExt($result[3]);
					$affiliated_with->setEmail($result[4]);
					$affiliated_withs[] = $affiliated_with;
				}// end while
			} else {
				$affiliated_withs = false;
			}
			return $affiliated_withs;
		}// end function

		// auction // --------------------

		public function createAuction($auction_id, $event_id, $date, $time) {
			global $con;
			$sql = 'INSERT INTO auction (auction_id, event_id, date, time) VALUES (' . $auction_id . ', ' . $event_id . ', ' . $date . ', ' . $time . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readAuction($id) {
			global $con;
			$sql = 'SELECT * FROM auction WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$auction = new Auction();
				$auction->setAuction($this->readAuction($result[0]));
				$auction->setEvent($this->readEvent($result[1]));
				$auction->setDate($result[2]);
				$auction->setTime($result[3]);
			} else {
				$auction = false;
			}
			return $auction;
		}// end function

		public function updateAuction($auction_id, $event_id, $date, $time) {
			global $con;
			$sql = 'UPDATE auction SET auction_id = ' . $auction_id . ', event_id = ' . $event_id . ', date = ' . $date . ', time = ' . $time . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteAuction($id) {
			global $con;
			$sql = 'DELETE FROM auction WHERE auction_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listAuction() {
			global $con;
			$sql = 'SELECT * FROM auction';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$auctions = array();
				while ($result = mysqli_fetch_array($results)) {
					$auction = new Auction();
					$auction->setAuction($this->readAuction($result[0]));
					$auction->setEvent($this->readEvent($result[1]));
					$auction->setDate($result[2]);
					$auction->setTime($result[3]);
					$auctions[] = $auction;
				}// end while
			} else {
				$auctions = false;
			}
			return $auctions;
		}// end function

		// auction_item // --------------------

		public function createAuction_item($id, $auction_id, $item_num, $title, $description, $value, $price, $buyer_id, $donation_id) {
			global $con;
			$sql = 'INSERT INTO auction_item (id, auction_id, item_num, title, description, value, price, buyer_id, donation_id) VALUES (' . $id . ', ' . $auction_id . ', ' . $item_num . ', ' . $title . ', ' . $description . ', ' . $value . ', ' . $price . ', ' . $buyer_id . ', ' . $donation_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readAuction_item($id) {
			global $con;
			$sql = 'SELECT * FROM auction_item WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$auction_item = new Auction_item();
				$auction_item->setId($result[0]);
				$auction_item->setAuction($this->readAuction($result[1]));
				$auction_item->setItemNum($result[2]);
				$auction_item->setTitle($result[3]);
				$auction_item->setDescription($result[4]);
				$auction_item->setValue($result[5]);
				$auction_item->setPrice($result[6]);
				$auction_item->setBuyer($this->readBuyer($result[7]));
				$auction_item->setDonation($this->readDonation($result[8]));
			} else {
				$auction_item = false;
			}
			return $auction_item;
		}// end function

		public function updateAuction_item($id, $auction_id, $item_num, $title, $description, $value, $price, $buyer_id, $donation_id) {
			global $con;
			$sql = 'UPDATE auction_item SET auction_id = ' . $auction_id . ', item_num = ' . $item_num . ', title = ' . $title . ', description = ' . $description . ', value = ' . $value . ', price = ' . $price . ', buyer_id = ' . $buyer_id . ', donation_id = ' . $donation_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteAuction_item($id) {
			global $con;
			$sql = 'DELETE FROM auction_item WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listAuction_item() {
			global $con;
			$sql = 'SELECT * FROM auction_item';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$auction_items = array();
				while ($result = mysqli_fetch_array($results)) {
					$auction_item = new Auction_item();
					$auction_item->setId($result[0]);
					$auction_item->setAuction($this->readAuction($result[1]));
					$auction_item->setItemNum($result[2]);
					$auction_item->setTitle($result[3]);
					$auction_item->setDescription($result[4]);
					$auction_item->setValue($result[5]);
					$auction_item->setPrice($result[6]);
					$auction_item->setBuyer($this->readBuyer($result[7]));
					$auction_item->setDonation($this->readDonation($result[8]));
					$auction_items[] = $auction_item;
				}// end while
			} else {
				$auction_items = false;
			}
			return $auction_items;
		}// end function

		// comimittee // --------------------

		public function createComimittee($id, $title, $date, $time) {
			global $con;
			$sql = 'INSERT INTO comimittee (id, title, date, time) VALUES (' . $id . ', ' . $title . ', ' . $date . ', ' . $time . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readComimittee($id) {
			global $con;
			$sql = 'SELECT * FROM comimittee WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$comimittee = new Comimittee();
				$comimittee->setId($result[0]);
				$comimittee->setTitle($result[1]);
				$comimittee->setDate($result[2]);
				$comimittee->setTime($result[3]);
			} else {
				$comimittee = false;
			}
			return $comimittee;
		}// end function

		public function updateComimittee($id, $title, $date, $time) {
			global $con;
			$sql = 'UPDATE comimittee SET title = ' . $title . ', date = ' . $date . ', time = ' . $time . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteComimittee($id) {
			global $con;
			$sql = 'DELETE FROM comimittee WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listComimittee() {
			global $con;
			$sql = 'SELECT * FROM comimittee';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$comimittees = array();
				while ($result = mysqli_fetch_array($results)) {
					$comimittee = new Comimittee();
					$comimittee->setId($result[0]);
					$comimittee->setTitle($result[1]);
					$comimittee->setDate($result[2]);
					$comimittee->setTime($result[3]);
					$comimittees[] = $comimittee;
				}// end while
			} else {
				$comimittees = false;
			}
			return $comimittees;
		}// end function

		// committee_attendance // --------------------

		public function createCommittee_attendance($id, $committee_id, $volunteer_id, $status) {
			global $con;
			$sql = 'INSERT INTO committee_attendance (id, committee_id, volunteer_id, status) VALUES (' . $id . ', ' . $committee_id . ', ' . $volunteer_id . ', ' . $status . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readCommittee_attendance($id) {
			global $con;
			$sql = 'SELECT * FROM committee_attendance WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$committee_attendance = new Committee_attendance();
				$committee_attendance->setId($result[0]);
				$committee_attendance->setCommittee($this->readCommittee($result[1]));
				$committee_attendance->setVolunteer($this->readVolunteer($result[2]));
				$committee_attendance->setStatus($result[3]);
			} else {
				$committee_attendance = false;
			}
			return $committee_attendance;
		}// end function

		public function updateCommittee_attendance($id, $committee_id, $volunteer_id, $status) {
			global $con;
			$sql = 'UPDATE committee_attendance SET committee_id = ' . $committee_id . ', volunteer_id = ' . $volunteer_id . ', status = ' . $status . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteCommittee_attendance($id) {
			global $con;
			$sql = 'DELETE FROM committee_attendance WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listCommittee_attendance() {
			global $con;
			$sql = 'SELECT * FROM committee_attendance';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$committee_attendances = array();
				while ($result = mysqli_fetch_array($results)) {
					$committee_attendance = new Committee_attendance();
					$committee_attendance->setId($result[0]);
					$committee_attendance->setCommittee($this->readCommittee($result[1]));
					$committee_attendance->setVolunteer($this->readVolunteer($result[2]));
					$committee_attendance->setStatus($result[3]);
					$committee_attendances[] = $committee_attendance;
				}// end while
			} else {
				$committee_attendances = false;
			}
			return $committee_attendances;
		}// end function

		// contact // --------------------

		public function createContact($id, $address_id, $phone, $email) {
			global $con;
			$sql = 'INSERT INTO contact (id, address_id, phone, email) VALUES (' . $id . ', ' . $address_id . ', ' . $phone . ', ' . $email . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readContact($id) {
			global $con;
			$sql = 'SELECT * FROM contact WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$contact = new Contact();
				$contact->setId($result[0]);
				$contact->setAddress($this->readAddress($result[1]));
				$contact->setPhone($result[2]);
				$contact->setEmail($result[3]);
			} else {
				$contact = false;
			}
			return $contact;
		}// end function

		public function updateContact($id, $address_id, $phone, $email) {
			global $con;
			$sql = 'UPDATE contact SET address_id = ' . $address_id . ', phone = ' . $phone . ', email = ' . $email . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteContact($id) {
			global $con;
			$sql = 'DELETE FROM contact WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listContact() {
			global $con;
			$sql = 'SELECT * FROM contact';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$contacts = array();
				while ($result = mysqli_fetch_array($results)) {
					$contact = new Contact();
					$contact->setId($result[0]);
					$contact->setAddress($this->readAddress($result[1]));
					$contact->setPhone($result[2]);
					$contact->setEmail($result[3]);
					$contacts[] = $contact;
				}// end while
			} else {
				$contacts = false;
			}
			return $contacts;
		}// end function

		// demographic // --------------------

		public function createDemographic($ho_id, $person_id, $demographic_id) {
			global $con;
			$sql = 'INSERT INTO demographic (ho_id, person_id, demographic_id) VALUES (' . $ho_id . ', ' . $person_id . ', ' . $demographic_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readDemographic($id) {
			global $con;
			$sql = 'SELECT * FROM demographic WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$demographic = new Demographic();
				$demographic->setHo($this->readHo($result[0]));
				$demographic->setPerson($this->readPerson($result[1]));
				$demographic->setDemographic($this->readDemographic($result[2]));
			} else {
				$demographic = false;
			}
			return $demographic;
		}// end function

		public function updateDemographic($ho_id, $person_id, $demographic_id) {
			global $con;
			$sql = 'UPDATE demographic SET ho_id = ' . $ho_id . ', person_id = ' . $person_id . ', demographic_id = ' . $demographic_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteDemographic($id) {
			global $con;
			$sql = 'DELETE FROM demographic WHERE ho_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listDemographic() {
			global $con;
			$sql = 'SELECT * FROM demographic';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$demographics = array();
				while ($result = mysqli_fetch_array($results)) {
					$demographic = new Demographic();
					$demographic->setHo($this->readHo($result[0]));
					$demographic->setPerson($this->readPerson($result[1]));
					$demographic->setDemographic($this->readDemographic($result[2]));
					$demographics[] = $demographic;
				}// end while
			} else {
				$demographics = false;
			}
			return $demographics;
		}// end function

		// demographic_type // --------------------

		public function createDemographic_type($id, $title, $description) {
			global $con;
			$sql = 'INSERT INTO demographic_type (id, title, description) VALUES (' . $id . ', ' . $title . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readDemographic_type($id) {
			global $con;
			$sql = 'SELECT * FROM demographic_type WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$demographic_type = new Demographic_type();
				$demographic_type->setId($result[0]);
				$demographic_type->setTitle($result[1]);
				$demographic_type->setDescription($result[2]);
			} else {
				$demographic_type = false;
			}
			return $demographic_type;
		}// end function

		public function updateDemographic_type($id, $title, $description) {
			global $con;
			$sql = 'UPDATE demographic_type SET title = ' . $title . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteDemographic_type($id) {
			global $con;
			$sql = 'DELETE FROM demographic_type WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listDemographic_type() {
			global $con;
			$sql = 'SELECT * FROM demographic_type';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$demographic_types = array();
				while ($result = mysqli_fetch_array($results)) {
					$demographic_type = new Demographic_type();
					$demographic_type->setId($result[0]);
					$demographic_type->setTitle($result[1]);
					$demographic_type->setDescription($result[2]);
					$demographic_types[] = $demographic_type;
				}// end while
			} else {
				$demographic_types = false;
			}
			return $demographic_types;
		}// end function

		// donation // --------------------

		public function createDonation($donation_id, $donor_id, $date, $time, $details, $when_entered, $who_entered, $type_id, $purpose_id, $pledge_id) {
			global $con;
			$sql = 'INSERT INTO donation (donation_id, donor_id, date, time, details, when_entered, who_entered, type_id, purpose_id, pledge_id) VALUES (' . $donation_id . ', ' . $donor_id . ', ' . $date . ', ' . $time . ', ' . $details . ', ' . $when_entered . ', ' . $who_entered . ', ' . $type_id . ', ' . $purpose_id . ', ' . $pledge_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readDonation($id) {
			global $con;
			$sql = 'SELECT * FROM donation WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$donation = new Donation();
				$donation->setDonation($this->readDonation($result[0]));
				$donation->setDonor($this->readDonor($result[1]));
				$donation->setDate($result[2]);
				$donation->setTime($result[3]);
				$donation->setDetails($result[4]);
				$donation->setWhenEntered($result[5]);
				$donation->setWhoEntered($result[6]);
				$donation->setType($this->readType($result[7]));
				$donation->setPurpose($this->readPurpose($result[8]));
				$donation->setPledge($this->readPledge($result[9]));
			} else {
				$donation = false;
			}
			return $donation;
		}// end function

		public function updateDonation($donation_id, $donor_id, $date, $time, $details, $when_entered, $who_entered, $type_id, $purpose_id, $pledge_id) {
			global $con;
			$sql = 'UPDATE donation SET donation_id = ' . $donation_id . ', donor_id = ' . $donor_id . ', date = ' . $date . ', time = ' . $time . ', details = ' . $details . ', when_entered = ' . $when_entered . ', who_entered = ' . $who_entered . ', type_id = ' . $type_id . ', purpose_id = ' . $purpose_id . ', pledge_id = ' . $pledge_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteDonation($id) {
			global $con;
			$sql = 'DELETE FROM donation WHERE donation_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listDonation() {
			global $con;
			$sql = 'SELECT * FROM donation';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$donations = array();
				while ($result = mysqli_fetch_array($results)) {
					$donation = new Donation();
					$donation->setDonation($this->readDonation($result[0]));
					$donation->setDonor($this->readDonor($result[1]));
					$donation->setDate($result[2]);
					$donation->setTime($result[3]);
					$donation->setDetails($result[4]);
					$donation->setWhenEntered($result[5]);
					$donation->setWhoEntered($result[6]);
					$donation->setType($this->readType($result[7]));
					$donation->setPurpose($this->readPurpose($result[8]));
					$donation->setPledge($this->readPledge($result[9]));
					$donations[] = $donation;
				}// end while
			} else {
				$donations = false;
			}
			return $donations;
		}// end function

		// donation_type // --------------------

		public function createDonation_type($type_id, $title, $description) {
			global $con;
			$sql = 'INSERT INTO donation_type (type_id, title, description) VALUES (' . $type_id . ', ' . $title . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readDonation_type($id) {
			global $con;
			$sql = 'SELECT * FROM donation_type WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$donation_type = new Donation_type();
				$donation_type->setType($this->readType($result[0]));
				$donation_type->setTitle($result[1]);
				$donation_type->setDescription($result[2]);
			} else {
				$donation_type = false;
			}
			return $donation_type;
		}// end function

		public function updateDonation_type($type_id, $title, $description) {
			global $con;
			$sql = 'UPDATE donation_type SET type_id = ' . $type_id . ', title = ' . $title . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteDonation_type($id) {
			global $con;
			$sql = 'DELETE FROM donation_type WHERE type_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listDonation_type() {
			global $con;
			$sql = 'SELECT * FROM donation_type';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$donation_types = array();
				while ($result = mysqli_fetch_array($results)) {
					$donation_type = new Donation_type();
					$donation_type->setType($this->readType($result[0]));
					$donation_type->setTitle($result[1]);
					$donation_type->setDescription($result[2]);
					$donation_types[] = $donation_type;
				}// end while
			} else {
				$donation_types = false;
			}
			return $donation_types;
		}// end function

		// donor_group // --------------------

		public function createDonor_group($donor_id, $contact_id) {
			global $con;
			$sql = 'INSERT INTO donor_group (donor_id, contact_id) VALUES (' . $donor_id . ', ' . $contact_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readDonor_group($id) {
			global $con;
			$sql = 'SELECT * FROM donor_group WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$donor_group = new Donor_group();
				$donor_group->setDonor($this->readDonor($result[0]));
				$donor_group->setContact($this->readContact($result[1]));
			} else {
				$donor_group = false;
			}
			return $donor_group;
		}// end function

		public function updateDonor_group($donor_id, $contact_id) {
			global $con;
			$sql = 'UPDATE donor_group SET donor_id = ' . $donor_id . ', contact_id = ' . $contact_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteDonor_group($id) {
			global $con;
			$sql = 'DELETE FROM donor_group WHERE donor_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listDonor_group() {
			global $con;
			$sql = 'SELECT * FROM donor_group';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$donor_groups = array();
				while ($result = mysqli_fetch_array($results)) {
					$donor_group = new Donor_group();
					$donor_group->setDonor($this->readDonor($result[0]));
					$donor_group->setContact($this->readContact($result[1]));
					$donor_groups[] = $donor_group;
				}// end while
			} else {
				$donor_groups = false;
			}
			return $donor_groups;
		}// end function

		// employed // --------------------

		public function createEmployed($person_id, $organization_id, $start_date, $end_date) {
			global $con;
			$sql = 'INSERT INTO employed (person_id, organization_id, start_date, end_date) VALUES (' . $person_id . ', ' . $organization_id . ', ' . $start_date . ', ' . $end_date . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readEmployed($id) {
			global $con;
			$sql = 'SELECT * FROM employed WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$employed = new Employed();
				$employed->setPerson($this->readPerson($result[0]));
				$employed->setOrganization($this->readOrganization($result[1]));
				$employed->setStartDate($result[2]);
				$employed->setEndDate($result[3]);
			} else {
				$employed = false;
			}
			return $employed;
		}// end function

		public function updateEmployed($person_id, $organization_id, $start_date, $end_date) {
			global $con;
			$sql = 'UPDATE employed SET person_id = ' . $person_id . ', organization_id = ' . $organization_id . ', start_date = ' . $start_date . ', end_date = ' . $end_date . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteEmployed($id) {
			global $con;
			$sql = 'DELETE FROM employed WHERE person_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listEmployed() {
			global $con;
			$sql = 'SELECT * FROM employed';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$employeds = array();
				while ($result = mysqli_fetch_array($results)) {
					$employed = new Employed();
					$employed->setPerson($this->readPerson($result[0]));
					$employed->setOrganization($this->readOrganization($result[1]));
					$employed->setStartDate($result[2]);
					$employed->setEndDate($result[3]);
					$employeds[] = $employed;
				}// end while
			} else {
				$employeds = false;
			}
			return $employeds;
		}// end function

		// event // --------------------

		public function createEvent($id, $title, $date, $time, $address_id, $type_id) {
			global $con;
			$sql = 'INSERT INTO event (id, title, date, time, address_id, type_id) VALUES (' . $id . ', ' . $title . ', ' . $date . ', ' . $time . ', ' . $address_id . ', ' . $type_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readEvent($id) {
			global $con;
			$sql = 'SELECT * FROM event WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$event = new Event();
				$event->setId($result[0]);
				$event->setTitle($result[1]);
				$event->setDate($result[2]);
				$event->setTime($result[3]);
				$event->setAddress($this->readAddress($result[4]));
				$event->setType($this->readType($result[5]));
			} else {
				$event = false;
			}
			return $event;
		}// end function

		public function updateEvent($id, $title, $date, $time, $address_id, $type_id) {
			global $con;
			$sql = 'UPDATE event SET title = ' . $title . ', date = ' . $date . ', time = ' . $time . ', address_id = ' . $address_id . ', type_id = ' . $type_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteEvent($id) {
			global $con;
			$sql = 'DELETE FROM event WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listEvent() {
			global $con;
			$sql = 'SELECT * FROM event';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$events = array();
				while ($result = mysqli_fetch_array($results)) {
					$event = new Event();
					$event->setId($result[0]);
					$event->setTitle($result[1]);
					$event->setDate($result[2]);
					$event->setTime($result[3]);
					$event->setAddress($this->readAddress($result[4]));
					$event->setType($this->readType($result[5]));
					$events[] = $event;
				}// end while
			} else {
				$events = false;
			}
			return $events;
		}// end function

		// event_expenses // --------------------

		public function createEvent_expenses($id, $event_id, $title, $description, $amount, $when_entered, $who_entered, $when_authorized, $who_authorized) {
			global $con;
			$sql = 'INSERT INTO event_expenses (id, event_id, title, description, amount, when_entered, who_entered, when_authorized, who_authorized) VALUES (' . $id . ', ' . $event_id . ', ' . $title . ', ' . $description . ', ' . $amount . ', ' . $when_entered . ', ' . $who_entered . ', ' . $when_authorized . ', ' . $who_authorized . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readEvent_expenses($id) {
			global $con;
			$sql = 'SELECT * FROM event_expenses WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$event_expenses = new Event_expenses();
				$event_expenses->setId($result[0]);
				$event_expenses->setEvent($this->readEvent($result[1]));
				$event_expenses->setTitle($result[2]);
				$event_expenses->setDescription($result[3]);
				$event_expenses->setAmount($result[4]);
				$event_expenses->setWhenEntered($result[5]);
				$event_expenses->setWhoEntered($result[6]);
				$event_expenses->setWhenAuthorized($result[7]);
				$event_expenses->setWhoAuthorized($result[8]);
			} else {
				$event_expenses = false;
			}
			return $event_expenses;
		}// end function

		public function updateEvent_expenses($id, $event_id, $title, $description, $amount, $when_entered, $who_entered, $when_authorized, $who_authorized) {
			global $con;
			$sql = 'UPDATE event_expenses SET event_id = ' . $event_id . ', title = ' . $title . ', description = ' . $description . ', amount = ' . $amount . ', when_entered = ' . $when_entered . ', who_entered = ' . $who_entered . ', when_authorized = ' . $when_authorized . ', who_authorized = ' . $who_authorized . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteEvent_expenses($id) {
			global $con;
			$sql = 'DELETE FROM event_expenses WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listEvent_expenses() {
			global $con;
			$sql = 'SELECT * FROM event_expenses';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$event_expensess = array();
				while ($result = mysqli_fetch_array($results)) {
					$event_expenses = new Event_expenses();
					$event_expenses->setId($result[0]);
					$event_expenses->setEvent($this->readEvent($result[1]));
					$event_expenses->setTitle($result[2]);
					$event_expenses->setDescription($result[3]);
					$event_expenses->setAmount($result[4]);
					$event_expenses->setWhenEntered($result[5]);
					$event_expenses->setWhoEntered($result[6]);
					$event_expenses->setWhenAuthorized($result[7]);
					$event_expenses->setWhoAuthorized($result[8]);
					$event_expensess[] = $event_expenses;
				}// end while
			} else {
				$event_expensess = false;
			}
			return $event_expensess;
		}// end function

		// event_type // --------------------

		public function createEvent_type($id, $title, $description) {
			global $con;
			$sql = 'INSERT INTO event_type (id, title, description) VALUES (' . $id . ', ' . $title . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readEvent_type($id) {
			global $con;
			$sql = 'SELECT * FROM event_type WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$event_type = new Event_type();
				$event_type->setId($result[0]);
				$event_type->setTitle($result[1]);
				$event_type->setDescription($result[2]);
			} else {
				$event_type = false;
			}
			return $event_type;
		}// end function

		public function updateEvent_type($id, $title, $description) {
			global $con;
			$sql = 'UPDATE event_type SET title = ' . $title . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteEvent_type($id) {
			global $con;
			$sql = 'DELETE FROM event_type WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listEvent_type() {
			global $con;
			$sql = 'SELECT * FROM event_type';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$event_types = array();
				while ($result = mysqli_fetch_array($results)) {
					$event_type = new Event_type();
					$event_type->setId($result[0]);
					$event_type->setTitle($result[1]);
					$event_type->setDescription($result[2]);
					$event_types[] = $event_type;
				}// end while
			} else {
				$event_types = false;
			}
			return $event_types;
		}// end function

		// foh // --------------------

		public function createFoh($event_id, $contact_id) {
			global $con;
			$sql = 'INSERT INTO foh (event_id, contact_id) VALUES (' . $event_id . ', ' . $contact_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readFoh($id) {
			global $con;
			$sql = 'SELECT * FROM foh WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$foh = new Foh();
				$foh->setEvent($this->readEvent($result[0]));
				$foh->setContact($this->readContact($result[1]));
			} else {
				$foh = false;
			}
			return $foh;
		}// end function

		public function updateFoh($event_id, $contact_id) {
			global $con;
			$sql = 'UPDATE foh SET event_id = ' . $event_id . ', contact_id = ' . $contact_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteFoh($id) {
			global $con;
			$sql = 'DELETE FROM foh WHERE event_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listFoh() {
			global $con;
			$sql = 'SELECT * FROM foh';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$fohs = array();
				while ($result = mysqli_fetch_array($results)) {
					$foh = new Foh();
					$foh->setEvent($this->readEvent($result[0]));
					$foh->setContact($this->readContact($result[1]));
					$fohs[] = $foh;
				}// end while
			} else {
				$fohs = false;
			}
			return $fohs;
		}// end function

		// for_project // --------------------

		public function createFor_project($project_id, $donation_id) {
			global $con;
			$sql = 'INSERT INTO for_project (project_id, donation_id) VALUES (' . $project_id . ', ' . $donation_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readFor_project($id) {
			global $con;
			$sql = 'SELECT * FROM for_project WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$for_project = new For_project();
				$for_project->setProject($this->readProject($result[0]));
				$for_project->setDonation($this->readDonation($result[1]));
			} else {
				$for_project = false;
			}
			return $for_project;
		}// end function

		public function updateFor_project($project_id, $donation_id) {
			global $con;
			$sql = 'UPDATE for_project SET project_id = ' . $project_id . ', donation_id = ' . $donation_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteFor_project($id) {
			global $con;
			$sql = 'DELETE FROM for_project WHERE project_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listFor_project() {
			global $con;
			$sql = 'SELECT * FROM for_project';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$for_projects = array();
				while ($result = mysqli_fetch_array($results)) {
					$for_project = new For_project();
					$for_project->setProject($this->readProject($result[0]));
					$for_project->setDonation($this->readDonation($result[1]));
					$for_projects[] = $for_project;
				}// end while
			} else {
				$for_projects = false;
			}
			return $for_projects;
		}// end function

		// guest_list // --------------------

		public function createGuest_list($event_id, $guest_id, $status) {
			global $con;
			$sql = 'INSERT INTO guest_list (event_id, guest_id, status) VALUES (' . $event_id . ', ' . $guest_id . ', ' . $status . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readGuest_list($id) {
			global $con;
			$sql = 'SELECT * FROM guest_list WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$guest_list = new Guest_list();
				$guest_list->setEvent($this->readEvent($result[0]));
				$guest_list->setGuest($this->readGuest($result[1]));
				$guest_list->setStatus($result[2]);
			} else {
				$guest_list = false;
			}
			return $guest_list;
		}// end function

		public function updateGuest_list($event_id, $guest_id, $status) {
			global $con;
			$sql = 'UPDATE guest_list SET event_id = ' . $event_id . ', guest_id = ' . $guest_id . ', status = ' . $status . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteGuest_list($id) {
			global $con;
			$sql = 'DELETE FROM guest_list WHERE event_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listGuest_list() {
			global $con;
			$sql = 'SELECT * FROM guest_list';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$guest_lists = array();
				while ($result = mysqli_fetch_array($results)) {
					$guest_list = new Guest_list();
					$guest_list->setEvent($this->readEvent($result[0]));
					$guest_list->setGuest($this->readGuest($result[1]));
					$guest_list->setStatus($result[2]);
					$guest_lists[] = $guest_list;
				}// end while
			} else {
				$guest_lists = false;
			}
			return $guest_lists;
		}// end function

		// ho_account // --------------------

		public function createHo_account($id, $ho_id, $type, $bank_id, $balance, $account_number, $routing_number) {
			global $con;
			$sql = 'INSERT INTO ho_account (id, ho_id, type, bank_id, balance, account_number, routing_number) VALUES (' . $id . ', ' . $ho_id . ', ' . $type . ', ' . $bank_id . ', ' . $balance . ', ' . $account_number . ', ' . $routing_number . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHo_account($id) {
			global $con;
			$sql = 'SELECT * FROM ho_account WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$ho_account = new Ho_account();
				$ho_account->setId($result[0]);
				$ho_account->setHo($this->readHo($result[1]));
				$ho_account->setType($result[2]);
				$ho_account->setBank($this->readBank($result[3]));
				$ho_account->setBalance($result[4]);
				$ho_account->setAccountNumber($result[5]);
				$ho_account->setRoutingNumber($result[6]);
			} else {
				$ho_account = false;
			}
			return $ho_account;
		}// end function

		public function updateHo_account($id, $ho_id, $type, $bank_id, $balance, $account_number, $routing_number) {
			global $con;
			$sql = 'UPDATE ho_account SET ho_id = ' . $ho_id . ', type = ' . $type . ', bank_id = ' . $bank_id . ', balance = ' . $balance . ', account_number = ' . $account_number . ', routing_number = ' . $routing_number . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHo_account($id) {
			global $con;
			$sql = 'DELETE FROM ho_account WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHo_account() {
			global $con;
			$sql = 'SELECT * FROM ho_account';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ho_accounts = array();
				while ($result = mysqli_fetch_array($results)) {
					$ho_account = new Ho_account();
					$ho_account->setId($result[0]);
					$ho_account->setHo($this->readHo($result[1]));
					$ho_account->setType($result[2]);
					$ho_account->setBank($this->readBank($result[3]));
					$ho_account->setBalance($result[4]);
					$ho_account->setAccountNumber($result[5]);
					$ho_account->setRoutingNumber($result[6]);
					$ho_accounts[] = $ho_account;
				}// end while
			} else {
				$ho_accounts = false;
			}
			return $ho_accounts;
		}// end function

		// ho_asset // --------------------

		public function createHo_asset($id, $ho_id, $title, $description, $value) {
			global $con;
			$sql = 'INSERT INTO ho_asset (id, ho_id, title, description, value) VALUES (' . $id . ', ' . $ho_id . ', ' . $title . ', ' . $description . ', ' . $value . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHo_asset($id) {
			global $con;
			$sql = 'SELECT * FROM ho_asset WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$ho_asset = new Ho_asset();
				$ho_asset->setId($result[0]);
				$ho_asset->setHo($this->readHo($result[1]));
				$ho_asset->setTitle($result[2]);
				$ho_asset->setDescription($result[3]);
				$ho_asset->setValue($result[4]);
			} else {
				$ho_asset = false;
			}
			return $ho_asset;
		}// end function

		public function updateHo_asset($id, $ho_id, $title, $description, $value) {
			global $con;
			$sql = 'UPDATE ho_asset SET ho_id = ' . $ho_id . ', title = ' . $title . ', description = ' . $description . ', value = ' . $value . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHo_asset($id) {
			global $con;
			$sql = 'DELETE FROM ho_asset WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHo_asset() {
			global $con;
			$sql = 'SELECT * FROM ho_asset';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ho_assets = array();
				while ($result = mysqli_fetch_array($results)) {
					$ho_asset = new Ho_asset();
					$ho_asset->setId($result[0]);
					$ho_asset->setHo($this->readHo($result[1]));
					$ho_asset->setTitle($result[2]);
					$ho_asset->setDescription($result[3]);
					$ho_asset->setValue($result[4]);
					$ho_assets[] = $ho_asset;
				}// end while
			} else {
				$ho_assets = false;
			}
			return $ho_assets;
		}// end function

		// ho_debt // --------------------

		public function createHo_debt($id, $ho_id, $debter_id, $monthly_payment, $balance) {
			global $con;
			$sql = 'INSERT INTO ho_debt (id, ho_id, debter_id, monthly_payment, balance) VALUES (' . $id . ', ' . $ho_id . ', ' . $debter_id . ', ' . $monthly_payment . ', ' . $balance . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHo_debt($id) {
			global $con;
			$sql = 'SELECT * FROM ho_debt WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$ho_debt = new Ho_debt();
				$ho_debt->setId($result[0]);
				$ho_debt->setHo($this->readHo($result[1]));
				$ho_debt->setDebter($this->readDebter($result[2]));
				$ho_debt->setMonthlyPayment($result[3]);
				$ho_debt->setBalance($result[4]);
			} else {
				$ho_debt = false;
			}
			return $ho_debt;
		}// end function

		public function updateHo_debt($id, $ho_id, $debter_id, $monthly_payment, $balance) {
			global $con;
			$sql = 'UPDATE ho_debt SET ho_id = ' . $ho_id . ', debter_id = ' . $debter_id . ', monthly_payment = ' . $monthly_payment . ', balance = ' . $balance . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHo_debt($id) {
			global $con;
			$sql = 'DELETE FROM ho_debt WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHo_debt() {
			global $con;
			$sql = 'SELECT * FROM ho_debt';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ho_debts = array();
				while ($result = mysqli_fetch_array($results)) {
					$ho_debt = new Ho_debt();
					$ho_debt->setId($result[0]);
					$ho_debt->setHo($this->readHo($result[1]));
					$ho_debt->setDebter($this->readDebter($result[2]));
					$ho_debt->setMonthlyPayment($result[3]);
					$ho_debt->setBalance($result[4]);
					$ho_debts[] = $ho_debt;
				}// end while
			} else {
				$ho_debts = false;
			}
			return $ho_debts;
		}// end function

		// ho_group // --------------------

		public function createHo_group($person_id, $ho_id, $date, $time, $photo_id) {
			global $con;
			$sql = 'INSERT INTO ho_group (person_id, ho_id, date, time, photo_id) VALUES (' . $person_id . ', ' . $ho_id . ', ' . $date . ', ' . $time . ', ' . $photo_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHo_group($id) {
			global $con;
			$sql = 'SELECT * FROM ho_group WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$ho_group = new Ho_group();
				$ho_group->setPerson($this->readPerson($result[0]));
				$ho_group->setHo($this->readHo($result[1]));
				$ho_group->setDate($result[2]);
				$ho_group->setTime($result[3]);
				$ho_group->setPhoto($this->readPhoto($result[4]));
			} else {
				$ho_group = false;
			}
			return $ho_group;
		}// end function

		public function updateHo_group($person_id, $ho_id, $date, $time, $photo_id) {
			global $con;
			$sql = 'UPDATE ho_group SET person_id = ' . $person_id . ', ho_id = ' . $ho_id . ', date = ' . $date . ', time = ' . $time . ', photo_id = ' . $photo_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHo_group($id) {
			global $con;
			$sql = 'DELETE FROM ho_group WHERE person_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHo_group() {
			global $con;
			$sql = 'SELECT * FROM ho_group';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ho_groups = array();
				while ($result = mysqli_fetch_array($results)) {
					$ho_group = new Ho_group();
					$ho_group->setPerson($this->readPerson($result[0]));
					$ho_group->setHo($this->readHo($result[1]));
					$ho_group->setDate($result[2]);
					$ho_group->setTime($result[3]);
					$ho_group->setPhoto($this->readPhoto($result[4]));
					$ho_groups[] = $ho_group;
				}// end while
			} else {
				$ho_groups = false;
			}
			return $ho_groups;
		}// end function

		// ho_income // --------------------

		public function createHo_income($id, $ho_id, $gross, $overtime, $commission, $child_support, $social_security, $disability, $pension, $unemployment) {
			global $con;
			$sql = 'INSERT INTO ho_income (id, ho_id, gross, overtime, commission, child_support, social_security, disability, pension, unemployment) VALUES (' . $id . ', ' . $ho_id . ', ' . $gross . ', ' . $overtime . ', ' . $commission . ', ' . $child_support . ', ' . $social_security . ', ' . $disability . ', ' . $pension . ', ' . $unemployment . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHo_income($id) {
			global $con;
			$sql = 'SELECT * FROM ho_income WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$ho_income = new Ho_income();
				$ho_income->setId($result[0]);
				$ho_income->setHo($this->readHo($result[1]));
				$ho_income->setGross($result[2]);
				$ho_income->setOvertime($result[3]);
				$ho_income->setCommission($result[4]);
				$ho_income->setChildSupport($result[5]);
				$ho_income->setSocialSecurity($result[6]);
				$ho_income->setDisability($result[7]);
				$ho_income->setPension($result[8]);
				$ho_income->setUnemployment($result[9]);
			} else {
				$ho_income = false;
			}
			return $ho_income;
		}// end function

		public function updateHo_income($id, $ho_id, $gross, $overtime, $commission, $child_support, $social_security, $disability, $pension, $unemployment) {
			global $con;
			$sql = 'UPDATE ho_income SET ho_id = ' . $ho_id . ', gross = ' . $gross . ', overtime = ' . $overtime . ', commission = ' . $commission . ', child_support = ' . $child_support . ', social_security = ' . $social_security . ', disability = ' . $disability . ', pension = ' . $pension . ', unemployment = ' . $unemployment . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHo_income($id) {
			global $con;
			$sql = 'DELETE FROM ho_income WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHo_income() {
			global $con;
			$sql = 'SELECT * FROM ho_income';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ho_incomes = array();
				while ($result = mysqli_fetch_array($results)) {
					$ho_income = new Ho_income();
					$ho_income->setId($result[0]);
					$ho_income->setHo($this->readHo($result[1]));
					$ho_income->setGross($result[2]);
					$ho_income->setOvertime($result[3]);
					$ho_income->setCommission($result[4]);
					$ho_income->setChildSupport($result[5]);
					$ho_income->setSocialSecurity($result[6]);
					$ho_income->setDisability($result[7]);
					$ho_income->setPension($result[8]);
					$ho_income->setUnemployment($result[9]);
					$ho_incomes[] = $ho_income;
				}// end while
			} else {
				$ho_incomes = false;
			}
			return $ho_incomes;
		}// end function

		// ho_requirement // --------------------

		public function createHo_requirement($ho_id, $requirement_id, $when_completed, $who_entered, $when_entered, $who_authorized, $when_authorized) {
			global $con;
			$sql = 'INSERT INTO ho_requirement (ho_id, requirement_id, when_completed, who_entered, when_entered, who_authorized, when_authorized) VALUES (' . $ho_id . ', ' . $requirement_id . ', ' . $when_completed . ', ' . $who_entered . ', ' . $when_entered . ', ' . $who_authorized . ', ' . $when_authorized . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHo_requirement($id) {
			global $con;
			$sql = 'SELECT * FROM ho_requirement WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$ho_requirement = new Ho_requirement();
				$ho_requirement->setHo($this->readHo($result[0]));
				$ho_requirement->setRequirement($this->readRequirement($result[1]));
				$ho_requirement->setWhenCompleted($result[2]);
				$ho_requirement->setWhoEntered($result[3]);
				$ho_requirement->setWhenEntered($result[4]);
				$ho_requirement->setWhoAuthorized($result[5]);
				$ho_requirement->setWhenAuthorized($result[6]);
			} else {
				$ho_requirement = false;
			}
			return $ho_requirement;
		}// end function

		public function updateHo_requirement($ho_id, $requirement_id, $when_completed, $who_entered, $when_entered, $who_authorized, $when_authorized) {
			global $con;
			$sql = 'UPDATE ho_requirement SET ho_id = ' . $ho_id . ', requirement_id = ' . $requirement_id . ', when_completed = ' . $when_completed . ', who_entered = ' . $who_entered . ', when_entered = ' . $when_entered . ', who_authorized = ' . $who_authorized . ', when_authorized = ' . $when_authorized . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHo_requirement($id) {
			global $con;
			$sql = 'DELETE FROM ho_requirement WHERE ho_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHo_requirement() {
			global $con;
			$sql = 'SELECT * FROM ho_requirement';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ho_requirements = array();
				while ($result = mysqli_fetch_array($results)) {
					$ho_requirement = new Ho_requirement();
					$ho_requirement->setHo($this->readHo($result[0]));
					$ho_requirement->setRequirement($this->readRequirement($result[1]));
					$ho_requirement->setWhenCompleted($result[2]);
					$ho_requirement->setWhoEntered($result[3]);
					$ho_requirement->setWhenEntered($result[4]);
					$ho_requirement->setWhoAuthorized($result[5]);
					$ho_requirement->setWhenAuthorized($result[6]);
					$ho_requirements[] = $ho_requirement;
				}// end while
			} else {
				$ho_requirements = false;
			}
			return $ho_requirements;
		}// end function

		// ho_status // --------------------

		public function createHo_status($id, $title, $code, $description) {
			global $con;
			$sql = 'INSERT INTO ho_status (id, title, code, description) VALUES (' . $id . ', ' . $title . ', ' . $code . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHo_status($id) {
			global $con;
			$sql = 'SELECT * FROM ho_status WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$ho_status = new Ho_status();
				$ho_status->setId($result[0]);
				$ho_status->setTitle($result[1]);
				$ho_status->setCode($result[2]);
				$ho_status->setDescription($result[3]);
			} else {
				$ho_status = false;
			}
			return $ho_status;
		}// end function

		public function updateHo_status($id, $title, $code, $description) {
			global $con;
			$sql = 'UPDATE ho_status SET title = ' . $title . ', code = ' . $code . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHo_status($id) {
			global $con;
			$sql = 'DELETE FROM ho_status WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHo_status() {
			global $con;
			$sql = 'SELECT * FROM ho_status';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ho_statuss = array();
				while ($result = mysqli_fetch_array($results)) {
					$ho_status = new Ho_status();
					$ho_status->setId($result[0]);
					$ho_status->setTitle($result[1]);
					$ho_status->setCode($result[2]);
					$ho_status->setDescription($result[3]);
					$ho_statuss[] = $ho_status;
				}// end while
			} else {
				$ho_statuss = false;
			}
			return $ho_statuss;
		}// end function

		// home_owner // --------------------

		public function createHome_owner($id, $status_id) {
			global $con;
			$sql = 'INSERT INTO home_owner (id, status_id) VALUES (' . $id . ', ' . $status_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readHome_owner($id) {
			global $con;
			$sql = 'SELECT * FROM home_owner WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$home_owner = new Home_owner();
				$home_owner->setId($result[0]);
				$home_owner->setStatus($this->readStatus($result[1]));
			} else {
				$home_owner = false;
			}
			return $home_owner;
		}// end function

		public function updateHome_owner($id, $status_id) {
			global $con;
			$sql = 'UPDATE home_owner SET status_id = ' . $status_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteHome_owner($id) {
			global $con;
			$sql = 'DELETE FROM home_owner WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listHome_owner() {
			global $con;
			$sql = 'SELECT * FROM home_owner';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$home_owners = array();
				while ($result = mysqli_fetch_array($results)) {
					$home_owner = new Home_owner();
					$home_owner->setId($result[0]);
					$home_owner->setStatus($this->readStatus($result[1]));
					$home_owners[] = $home_owner;
				}// end while
			} else {
				$home_owners = false;
			}
			return $home_owners;
		}// end function

		// interest // --------------------

		public function createInterest($id, $type_id, $title, $description) {
			global $con;
			$sql = 'INSERT INTO interest (id, type_id, title, description) VALUES (' . $id . ', ' . $type_id . ', ' . $title . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readInterest($id) {
			global $con;
			$sql = 'SELECT * FROM interest WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$interest = new Interest();
				$interest->setId($result[0]);
				$interest->setType($this->readType($result[1]));
				$interest->setTitle($result[2]);
				$interest->setDescription($result[3]);
			} else {
				$interest = false;
			}
			return $interest;
		}// end function

		public function updateInterest($id, $type_id, $title, $description) {
			global $con;
			$sql = 'UPDATE interest SET type_id = ' . $type_id . ', title = ' . $title . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteInterest($id) {
			global $con;
			$sql = 'DELETE FROM interest WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listInterest() {
			global $con;
			$sql = 'SELECT * FROM interest';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$interests = array();
				while ($result = mysqli_fetch_array($results)) {
					$interest = new Interest();
					$interest->setId($result[0]);
					$interest->setType($this->readType($result[1]));
					$interest->setTitle($result[2]);
					$interest->setDescription($result[3]);
					$interests[] = $interest;
				}// end while
			} else {
				$interests = false;
			}
			return $interests;
		}// end function

		// interest_type // --------------------

		public function createInterest_type($id, $title, $description) {
			global $con;
			$sql = 'INSERT INTO interest_type (id, title, description) VALUES (' . $id . ', ' . $title . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readInterest_type($id) {
			global $con;
			$sql = 'SELECT * FROM interest_type WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$interest_type = new Interest_type();
				$interest_type->setId($result[0]);
				$interest_type->setTitle($result[1]);
				$interest_type->setDescription($result[2]);
			} else {
				$interest_type = false;
			}
			return $interest_type;
		}// end function

		public function updateInterest_type($id, $title, $description) {
			global $con;
			$sql = 'UPDATE interest_type SET title = ' . $title . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteInterest_type($id) {
			global $con;
			$sql = 'DELETE FROM interest_type WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listInterest_type() {
			global $con;
			$sql = 'SELECT * FROM interest_type';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$interest_types = array();
				while ($result = mysqli_fetch_array($results)) {
					$interest_type = new Interest_type();
					$interest_type->setId($result[0]);
					$interest_type->setTitle($result[1]);
					$interest_type->setDescription($result[2]);
					$interest_types[] = $interest_type;
				}// end while
			} else {
				$interest_types = false;
			}
			return $interest_types;
		}// end function

		// interested_in // --------------------

		public function createInterested_in($volunteer_id, $interest_id) {
			global $con;
			$sql = 'INSERT INTO interested_in (volunteer_id, interest_id) VALUES (' . $volunteer_id . ', ' . $interest_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readInterested_in($id) {
			global $con;
			$sql = 'SELECT * FROM interested_in WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$interested_in = new Interested_in();
				$interested_in->setVolunteer($this->readVolunteer($result[0]));
				$interested_in->setInterest($this->readInterest($result[1]));
			} else {
				$interested_in = false;
			}
			return $interested_in;
		}// end function

		public function updateInterested_in($volunteer_id, $interest_id) {
			global $con;
			$sql = 'UPDATE interested_in SET volunteer_id = ' . $volunteer_id . ', interest_id = ' . $interest_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteInterested_in($id) {
			global $con;
			$sql = 'DELETE FROM interested_in WHERE volunteer_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listInterested_in() {
			global $con;
			$sql = 'SELECT * FROM interested_in';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$interested_ins = array();
				while ($result = mysqli_fetch_array($results)) {
					$interested_in = new Interested_in();
					$interested_in->setVolunteer($this->readVolunteer($result[0]));
					$interested_in->setInterest($this->readInterest($result[1]));
					$interested_ins[] = $interested_in;
				}// end while
			} else {
				$interested_ins = false;
			}
			return $interested_ins;
		}// end function

		// labor // --------------------

		public function createLabor($donation_id, $amount, $method, $project_id) {
			global $con;
			$sql = 'INSERT INTO labor (donation_id, amount, method, project_id) VALUES (' . $donation_id . ', ' . $amount . ', ' . $method . ', ' . $project_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readLabor($id) {
			global $con;
			$sql = 'SELECT * FROM labor WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$labor = new Labor();
				$labor->setDonation($this->readDonation($result[0]));
				$labor->setAmount($result[1]);
				$labor->setMethod($result[2]);
				$labor->setProject($this->readProject($result[3]));
			} else {
				$labor = false;
			}
			return $labor;
		}// end function

		public function updateLabor($donation_id, $amount, $method, $project_id) {
			global $con;
			$sql = 'UPDATE labor SET donation_id = ' . $donation_id . ', amount = ' . $amount . ', method = ' . $method . ', project_id = ' . $project_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteLabor($id) {
			global $con;
			$sql = 'DELETE FROM labor WHERE donation_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listLabor() {
			global $con;
			$sql = 'SELECT * FROM labor';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$labors = array();
				while ($result = mysqli_fetch_array($results)) {
					$labor = new Labor();
					$labor->setDonation($this->readDonation($result[0]));
					$labor->setAmount($result[1]);
					$labor->setMethod($result[2]);
					$labor->setProject($this->readProject($result[3]));
					$labors[] = $labor;
				}// end while
			} else {
				$labors = false;
			}
			return $labors;
		}// end function

		// marital_status // --------------------

		public function createMarital_status($status_id, $person_id) {
			global $con;
			$sql = 'INSERT INTO marital_status (status_id, person_id) VALUES (' . $status_id . ', ' . $person_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readMarital_status($id) {
			global $con;
			$sql = 'SELECT * FROM marital_status WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$marital_status = new Marital_status();
				$marital_status->setStatus($this->readStatus($result[0]));
				$marital_status->setPerson($this->readPerson($result[1]));
			} else {
				$marital_status = false;
			}
			return $marital_status;
		}// end function

		public function updateMarital_status($status_id, $person_id) {
			global $con;
			$sql = 'UPDATE marital_status SET status_id = ' . $status_id . ', person_id = ' . $person_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteMarital_status($id) {
			global $con;
			$sql = 'DELETE FROM marital_status WHERE status_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listMarital_status() {
			global $con;
			$sql = 'SELECT * FROM marital_status';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$marital_statuss = array();
				while ($result = mysqli_fetch_array($results)) {
					$marital_status = new Marital_status();
					$marital_status->setStatus($this->readStatus($result[0]));
					$marital_status->setPerson($this->readPerson($result[1]));
					$marital_statuss[] = $marital_status;
				}// end while
			} else {
				$marital_statuss = false;
			}
			return $marital_statuss;
		}// end function

		// marital_statuses // --------------------

		public function createMarital_statuses($id, $title, $description) {
			global $con;
			$sql = 'INSERT INTO marital_statuses (id, title, description) VALUES (' . $id . ', ' . $title . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readMarital_statuses($id) {
			global $con;
			$sql = 'SELECT * FROM marital_statuses WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$marital_statuses = new Marital_statuses();
				$marital_statuses->setId($result[0]);
				$marital_statuses->setTitle($result[1]);
				$marital_statuses->setDescription($result[2]);
			} else {
				$marital_statuses = false;
			}
			return $marital_statuses;
		}// end function

		public function updateMarital_statuses($id, $title, $description) {
			global $con;
			$sql = 'UPDATE marital_statuses SET title = ' . $title . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteMarital_statuses($id) {
			global $con;
			$sql = 'DELETE FROM marital_statuses WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listMarital_statuses() {
			global $con;
			$sql = 'SELECT * FROM marital_statuses';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$marital_statusess = array();
				while ($result = mysqli_fetch_array($results)) {
					$marital_statuses = new Marital_statuses();
					$marital_statuses->setId($result[0]);
					$marital_statuses->setTitle($result[1]);
					$marital_statuses->setDescription($result[2]);
					$marital_statusess[] = $marital_statuses;
				}// end while
			} else {
				$marital_statusess = false;
			}
			return $marital_statusess;
		}// end function

		// material // --------------------

		public function createMaterial($donation_id, $value, $description) {
			global $con;
			$sql = 'INSERT INTO material (donation_id, value, description) VALUES (' . $donation_id . ', ' . $value . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readMaterial($id) {
			global $con;
			$sql = 'SELECT * FROM material WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$material = new Material();
				$material->setDonation($this->readDonation($result[0]));
				$material->setValue($result[1]);
				$material->setDescription($result[2]);
			} else {
				$material = false;
			}
			return $material;
		}// end function

		public function updateMaterial($donation_id, $value, $description) {
			global $con;
			$sql = 'UPDATE material SET donation_id = ' . $donation_id . ', value = ' . $value . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteMaterial($id) {
			global $con;
			$sql = 'DELETE FROM material WHERE donation_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listMaterial() {
			global $con;
			$sql = 'SELECT * FROM material';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$materials = array();
				while ($result = mysqli_fetch_array($results)) {
					$material = new Material();
					$material->setDonation($this->readDonation($result[0]));
					$material->setValue($result[1]);
					$material->setDescription($result[2]);
					$materials[] = $material;
				}// end while
			} else {
				$materials = false;
			}
			return $materials;
		}// end function

		// monies // --------------------

		public function createMonies($donation_id, $amount, $method) {
			global $con;
			$sql = 'INSERT INTO monies (donation_id, amount, method) VALUES (' . $donation_id . ', ' . $amount . ', ' . $method . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readMonies($id) {
			global $con;
			$sql = 'SELECT * FROM monies WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$monies = new Monies();
				$monies->setDonation($this->readDonation($result[0]));
				$monies->setAmount($result[1]);
				$monies->setMethod($result[2]);
			} else {
				$monies = false;
			}
			return $monies;
		}// end function

		public function updateMonies($donation_id, $amount, $method) {
			global $con;
			$sql = 'UPDATE monies SET donation_id = ' . $donation_id . ', amount = ' . $amount . ', method = ' . $method . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteMonies($id) {
			global $con;
			$sql = 'DELETE FROM monies WHERE donation_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listMonies() {
			global $con;
			$sql = 'SELECT * FROM monies';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$moniess = array();
				while ($result = mysqli_fetch_array($results)) {
					$monies = new Monies();
					$monies->setDonation($this->readDonation($result[0]));
					$monies->setAmount($result[1]);
					$monies->setMethod($result[2]);
					$moniess[] = $monies;
				}// end while
			} else {
				$moniess = false;
			}
			return $moniess;
		}// end function

		// mortgage // --------------------

		public function createMortgage($id, $amount, $status, $project_id, $ho_id, $bank_id) {
			global $con;
			$sql = 'INSERT INTO mortgage (id, amount, status, project_id, ho_id, bank_id) VALUES (' . $id . ', ' . $amount . ', ' . $status . ', ' . $project_id . ', ' . $ho_id . ', ' . $bank_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readMortgage($id) {
			global $con;
			$sql = 'SELECT * FROM mortgage WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$mortgage = new Mortgage();
				$mortgage->setId($result[0]);
				$mortgage->setAmount($result[1]);
				$mortgage->setStatus($result[2]);
				$mortgage->setProject($this->readProject($result[3]));
				$mortgage->setHo($this->readHo($result[4]));
				$mortgage->setBank($this->readBank($result[5]));
			} else {
				$mortgage = false;
			}
			return $mortgage;
		}// end function

		public function updateMortgage($id, $amount, $status, $project_id, $ho_id, $bank_id) {
			global $con;
			$sql = 'UPDATE mortgage SET amount = ' . $amount . ', status = ' . $status . ', project_id = ' . $project_id . ', ho_id = ' . $ho_id . ', bank_id = ' . $bank_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteMortgage($id) {
			global $con;
			$sql = 'DELETE FROM mortgage WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listMortgage() {
			global $con;
			$sql = 'SELECT * FROM mortgage';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$mortgages = array();
				while ($result = mysqli_fetch_array($results)) {
					$mortgage = new Mortgage();
					$mortgage->setId($result[0]);
					$mortgage->setAmount($result[1]);
					$mortgage->setStatus($result[2]);
					$mortgage->setProject($this->readProject($result[3]));
					$mortgage->setHo($this->readHo($result[4]));
					$mortgage->setBank($this->readBank($result[5]));
					$mortgages[] = $mortgage;
				}// end while
			} else {
				$mortgages = false;
			}
			return $mortgages;
		}// end function

		// municipality // --------------------

		public function createMunicipality($id, $title) {
			global $con;
			$sql = 'INSERT INTO municipality (id, title) VALUES (' . $id . ', ' . $title . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readMunicipality($id) {
			global $con;
			$sql = 'SELECT * FROM municipality WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$municipality = new Municipality();
				$municipality->setId($result[0]);
				$municipality->setTitle($result[1]);
			} else {
				$municipality = false;
			}
			return $municipality;
		}// end function

		public function updateMunicipality($id, $title) {
			global $con;
			$sql = 'UPDATE municipality SET title = ' . $title . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteMunicipality($id) {
			global $con;
			$sql = 'DELETE FROM municipality WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listMunicipality() {
			global $con;
			$sql = 'SELECT * FROM municipality';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$municipalitys = array();
				while ($result = mysqli_fetch_array($results)) {
					$municipality = new Municipality();
					$municipality->setId($result[0]);
					$municipality->setTitle($result[1]);
					$municipalitys[] = $municipality;
				}// end while
			} else {
				$municipalitys = false;
			}
			return $municipalitys;
		}// end function

		// notes // --------------------

		public function createNotes($id, $note, $author_id, $author_date) {
			global $con;
			$sql = 'INSERT INTO notes (id, note, author_id, author_date) VALUES (' . $id . ', ' . $note . ', ' . $author_id . ', ' . $author_date . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readNotes($id) {
			global $con;
			$sql = 'SELECT * FROM notes WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$notes = new Notes();
				$notes->setId($result[0]);
				$notes->setNote($result[1]);
				$notes->setAuthor($this->readAuthor($result[2]));
				$notes->setAuthorDate($result[3]);
			} else {
				$notes = false;
			}
			return $notes;
		}// end function

		public function updateNotes($id, $note, $author_id, $author_date) {
			global $con;
			$sql = 'UPDATE notes SET note = ' . $note . ', author_id = ' . $author_id . ', author_date = ' . $author_date . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteNotes($id) {
			global $con;
			$sql = 'DELETE FROM notes WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listNotes() {
			global $con;
			$sql = 'SELECT * FROM notes';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$notess = array();
				while ($result = mysqli_fetch_array($results)) {
					$notes = new Notes();
					$notes->setId($result[0]);
					$notes->setNote($result[1]);
					$notes->setAuthor($this->readAuthor($result[2]));
					$notes->setAuthorDate($result[3]);
					$notess[] = $notes;
				}// end while
			} else {
				$notess = false;
			}
			return $notess;
		}// end function

		// organization // --------------------

		public function createOrganization($id, $name) {
			global $con;
			$sql = 'INSERT INTO organization (id, name) VALUES (' . $id . ', ' . $name . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readOrganization($id) {
			global $con;
			$sql = 'SELECT * FROM organization WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$organization = new Organization();
				$organization->setId($result[0]);
				$organization->setName($result[1]);
			} else {
				$organization = false;
			}
			return $organization;
		}// end function

		public function updateOrganization($id, $name) {
			global $con;
			$sql = 'UPDATE organization SET name = ' . $name . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteOrganization($id) {
			global $con;
			$sql = 'DELETE FROM organization WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listOrganization() {
			global $con;
			$sql = 'SELECT * FROM organization';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$organizations = array();
				while ($result = mysqli_fetch_array($results)) {
					$organization = new Organization();
					$organization->setId($result[0]);
					$organization->setName($result[1]);
					$organizations[] = $organization;
				}// end while
			} else {
				$organizations = false;
			}
			return $organizations;
		}// end function

		// payment // --------------------

		public function createPayment($id, $mortgage_id, $amount, $date, $time, $person_id) {
			global $con;
			$sql = 'INSERT INTO payment (id, mortgage_id, amount, date, time, person_id) VALUES (' . $id . ', ' . $mortgage_id . ', ' . $amount . ', ' . $date . ', ' . $time . ', ' . $person_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readPayment($id) {
			global $con;
			$sql = 'SELECT * FROM payment WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$payment = new Payment();
				$payment->setId($result[0]);
				$payment->setMortgage($this->readMortgage($result[1]));
				$payment->setAmount($result[2]);
				$payment->setDate($result[3]);
				$payment->setTime($result[4]);
				$payment->setPerson($this->readPerson($result[5]));
			} else {
				$payment = false;
			}
			return $payment;
		}// end function

		public function updatePayment($id, $mortgage_id, $amount, $date, $time, $person_id) {
			global $con;
			$sql = 'UPDATE payment SET mortgage_id = ' . $mortgage_id . ', amount = ' . $amount . ', date = ' . $date . ', time = ' . $time . ', person_id = ' . $person_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deletePayment($id) {
			global $con;
			$sql = 'DELETE FROM payment WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listPayment() {
			global $con;
			$sql = 'SELECT * FROM payment';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$payments = array();
				while ($result = mysqli_fetch_array($results)) {
					$payment = new Payment();
					$payment->setId($result[0]);
					$payment->setMortgage($this->readMortgage($result[1]));
					$payment->setAmount($result[2]);
					$payment->setDate($result[3]);
					$payment->setTime($result[4]);
					$payment->setPerson($this->readPerson($result[5]));
					$payments[] = $payment;
				}// end while
			} else {
				$payments = false;
			}
			return $payments;
		}// end function

		// person // --------------------

		public function createPerson($id, $title, $first_name, $last_name, $gender, $dob) {
			global $con;
			$sql = 'INSERT INTO person (id, title, first_name, last_name, gender, dob) VALUES (' . $id . ', ' . $title . ', ' . $first_name . ', ' . $last_name . ', ' . $gender . ', ' . $dob . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readPerson($id) {
			global $con;
			$sql = 'SELECT * FROM person WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$person = new Person();
				$person->setId($result[0]);
				$person->setTitle($result[1]);
				$person->setFirstName($result[2]);
				$person->setLastName($result[3]);
				$person->setGender($result[4]);
				$person->setDob($result[5]);
			} else {
				$person = false;
			}
			return $person;
		}// end function

		public function updatePerson($id, $title, $first_name, $last_name, $gender, $dob) {
			global $con;
			$sql = 'UPDATE person SET title = ' . $title . ', first_name = ' . $first_name . ', last_name = ' . $last_name . ', gender = ' . $gender . ', dob = ' . $dob . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deletePerson($id) {
			global $con;
			$sql = 'DELETE FROM person WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listPerson() {
			global $con;
			$sql = 'SELECT * FROM person';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$persons = array();
				while ($result = mysqli_fetch_array($results)) {
					$person = new Person();
					$person->setId($result[0]);
					$person->setTitle($result[1]);
					$person->setFirstName($result[2]);
					$person->setLastName($result[3]);
					$person->setGender($result[4]);
					$person->setDob($result[5]);
					$persons[] = $person;
				}// end while
			} else {
				$persons = false;
			}
			return $persons;
		}// end function

		// pledge // --------------------

		public function createPledge($id, $donor_id, $date, $time, $details, $when_entered, $who_entered, $type_id, $purpose_id) {
			global $con;
			$sql = 'INSERT INTO pledge (id, donor_id, date, time, details, when_entered, who_entered, type_id, purpose_id) VALUES (' . $id . ', ' . $donor_id . ', ' . $date . ', ' . $time . ', ' . $details . ', ' . $when_entered . ', ' . $who_entered . ', ' . $type_id . ', ' . $purpose_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readPledge($id) {
			global $con;
			$sql = 'SELECT * FROM pledge WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$pledge = new Pledge();
				$pledge->setId($result[0]);
				$pledge->setDonor($this->readDonor($result[1]));
				$pledge->setDate($result[2]);
				$pledge->setTime($result[3]);
				$pledge->setDetails($result[4]);
				$pledge->setWhenEntered($result[5]);
				$pledge->setWhoEntered($result[6]);
				$pledge->setType($this->readType($result[7]));
				$pledge->setPurpose($this->readPurpose($result[8]));
			} else {
				$pledge = false;
			}
			return $pledge;
		}// end function

		public function updatePledge($id, $donor_id, $date, $time, $details, $when_entered, $who_entered, $type_id, $purpose_id) {
			global $con;
			$sql = 'UPDATE pledge SET donor_id = ' . $donor_id . ', date = ' . $date . ', time = ' . $time . ', details = ' . $details . ', when_entered = ' . $when_entered . ', who_entered = ' . $who_entered . ', type_id = ' . $type_id . ', purpose_id = ' . $purpose_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deletePledge($id) {
			global $con;
			$sql = 'DELETE FROM pledge WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listPledge() {
			global $con;
			$sql = 'SELECT * FROM pledge';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$pledges = array();
				while ($result = mysqli_fetch_array($results)) {
					$pledge = new Pledge();
					$pledge->setId($result[0]);
					$pledge->setDonor($this->readDonor($result[1]));
					$pledge->setDate($result[2]);
					$pledge->setTime($result[3]);
					$pledge->setDetails($result[4]);
					$pledge->setWhenEntered($result[5]);
					$pledge->setWhoEntered($result[6]);
					$pledge->setType($this->readType($result[7]));
					$pledge->setPurpose($this->readPurpose($result[8]));
					$pledges[] = $pledge;
				}// end while
			} else {
				$pledges = false;
			}
			return $pledges;
		}// end function

		// project // --------------------

		public function createProject($id, $is_active, $address_id, $municipality_id, $sponsor_id, $date_of_origin, $start_date, $estimated_completion_date, $actual_completion_date, $description, $extimated_valutation, $estimated_purchase, $estimated_rehab, $estimated_Pre-Acq, $actual_pre_acq, $estimated_sponser_value, $estimated_donation_value, $estimated_sell_price, $estimated_volunteer_hours, $estimated_purchase_cost, $actual_purchase_cost, $materials_budger, $labor_budget, $subContract_budget, $indirectAllocation_budget, $buyer_hours_required, $estimated_selling_price, $actual_appraisal_value, $actual_sell_price) {
			global $con;
			$sql = 'INSERT INTO project (id, is_active, address_id, municipality_id, sponsor_id, date_of_origin, start_date, estimated_completion_date, actual_completion_date, description, extimated_valutation, estimated_purchase, estimated_rehab, estimated_Pre-Acq, actual_pre_acq, estimated_sponser_value, estimated_donation_value, estimated_sell_price, estimated_volunteer_hours, estimated_purchase_cost, actual_purchase_cost, materials_budger, labor_budget, subContract_budget, indirectAllocation_budget, buyer_hours_required, estimated_selling_price, actual_appraisal_value, actual_sell_price) VALUES (' . $id . ', ' . $is_active . ', ' . $address_id . ', ' . $municipality_id . ', ' . $sponsor_id . ', ' . $date_of_origin . ', ' . $start_date . ', ' . $estimated_completion_date . ', ' . $actual_completion_date . ', ' . $description . ', ' . $extimated_valutation . ', ' . $estimated_purchase . ', ' . $estimated_rehab . ', ' . $estimated_Pre-Acq . ', ' . $actual_pre_acq . ', ' . $estimated_sponser_value . ', ' . $estimated_donation_value . ', ' . $estimated_sell_price . ', ' . $estimated_volunteer_hours . ', ' . $estimated_purchase_cost . ', ' . $actual_purchase_cost . ', ' . $materials_budger . ', ' . $labor_budget . ', ' . $subContract_budget . ', ' . $indirectAllocation_budget . ', ' . $buyer_hours_required . ', ' . $estimated_selling_price . ', ' . $actual_appraisal_value . ', ' . $actual_sell_price . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readProject($id) {
			global $con;
			$sql = 'SELECT * FROM project WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$project = new Project();
				$project->setId($result[0]);
				$project->setIsActive($result[1]);
				$project->setAddress($this->readAddress($result[2]));
				$project->setMunicipality($this->readMunicipality($result[3]));
				$project->setSponsor($this->readSponsor($result[4]));
				$project->setDateOfOrigin($result[5]);
				$project->setStartDate($result[6]);
				$project->setEstimatedCompletionDate($result[7]);
				$project->setActualCompletionDate($result[8]);
				$project->setDescription($result[9]);
				$project->setExtimatedValutation($result[10]);
				$project->setEstimatedPurchase($result[11]);
				$project->setEstimatedRehab($result[12]);
				$project->setEstimatedPre-Acq($result[13]);
				$project->setActualPreAcq($result[14]);
				$project->setEstimatedSponserValue($result[15]);
				$project->setEstimatedDonationValue($result[16]);
				$project->setEstimatedSellPrice($result[17]);
				$project->setEstimatedVolunteerHours($result[18]);
				$project->setEstimatedPurchaseCost($result[19]);
				$project->setActualPurchaseCost($result[20]);
				$project->setMaterialsBudger($result[21]);
				$project->setLaborBudget($result[22]);
				$project->setSubContractBudget($result[23]);
				$project->setIndirectAllocationBudget($result[24]);
				$project->setBuyerHoursRequired($result[25]);
				$project->setEstimatedSellingPrice($result[26]);
				$project->setActualAppraisalValue($result[27]);
				$project->setActualSellPrice($result[28]);
			} else {
				$project = false;
			}
			return $project;
		}// end function

		public function updateProject($id, $is_active, $address_id, $municipality_id, $sponsor_id, $date_of_origin, $start_date, $estimated_completion_date, $actual_completion_date, $description, $extimated_valutation, $estimated_purchase, $estimated_rehab, $estimated_Pre-Acq, $actual_pre_acq, $estimated_sponser_value, $estimated_donation_value, $estimated_sell_price, $estimated_volunteer_hours, $estimated_purchase_cost, $actual_purchase_cost, $materials_budger, $labor_budget, $subContract_budget, $indirectAllocation_budget, $buyer_hours_required, $estimated_selling_price, $actual_appraisal_value, $actual_sell_price) {
			global $con;
			$sql = 'UPDATE project SET is_active = ' . $is_active . ', address_id = ' . $address_id . ', municipality_id = ' . $municipality_id . ', sponsor_id = ' . $sponsor_id . ', date_of_origin = ' . $date_of_origin . ', start_date = ' . $start_date . ', estimated_completion_date = ' . $estimated_completion_date . ', actual_completion_date = ' . $actual_completion_date . ', description = ' . $description . ', extimated_valutation = ' . $extimated_valutation . ', estimated_purchase = ' . $estimated_purchase . ', estimated_rehab = ' . $estimated_rehab . ', estimated_Pre-Acq = ' . $estimated_Pre-Acq . ', actual_pre_acq = ' . $actual_pre_acq . ', estimated_sponser_value = ' . $estimated_sponser_value . ', estimated_donation_value = ' . $estimated_donation_value . ', estimated_sell_price = ' . $estimated_sell_price . ', estimated_volunteer_hours = ' . $estimated_volunteer_hours . ', estimated_purchase_cost = ' . $estimated_purchase_cost . ', actual_purchase_cost = ' . $actual_purchase_cost . ', materials_budger = ' . $materials_budger . ', labor_budget = ' . $labor_budget . ', subContract_budget = ' . $subContract_budget . ', indirectAllocation_budget = ' . $indirectAllocation_budget . ', buyer_hours_required = ' . $buyer_hours_required . ', estimated_selling_price = ' . $estimated_selling_price . ', actual_appraisal_value = ' . $actual_appraisal_value . ', actual_sell_price = ' . $actual_sell_price . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteProject($id) {
			global $con;
			$sql = 'DELETE FROM project WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listProject() {
			global $con;
			$sql = 'SELECT * FROM project';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$projects = array();
				while ($result = mysqli_fetch_array($results)) {
					$project = new Project();
					$project->setId($result[0]);
					$project->setIsActive($result[1]);
					$project->setAddress($this->readAddress($result[2]));
					$project->setMunicipality($this->readMunicipality($result[3]));
					$project->setSponsor($this->readSponsor($result[4]));
					$project->setDateOfOrigin($result[5]);
					$project->setStartDate($result[6]);
					$project->setEstimatedCompletionDate($result[7]);
					$project->setActualCompletionDate($result[8]);
					$project->setDescription($result[9]);
					$project->setExtimatedValutation($result[10]);
					$project->setEstimatedPurchase($result[11]);
					$project->setEstimatedRehab($result[12]);
					$project->setEstimatedPre-Acq($result[13]);
					$project->setActualPreAcq($result[14]);
					$project->setEstimatedSponserValue($result[15]);
					$project->setEstimatedDonationValue($result[16]);
					$project->setEstimatedSellPrice($result[17]);
					$project->setEstimatedVolunteerHours($result[18]);
					$project->setEstimatedPurchaseCost($result[19]);
					$project->setActualPurchaseCost($result[20]);
					$project->setMaterialsBudger($result[21]);
					$project->setLaborBudget($result[22]);
					$project->setSubContractBudget($result[23]);
					$project->setIndirectAllocationBudget($result[24]);
					$project->setBuyerHoursRequired($result[25]);
					$project->setEstimatedSellingPrice($result[26]);
					$project->setActualAppraisalValue($result[27]);
					$project->setActualSellPrice($result[28]);
					$projects[] = $project;
				}// end while
			} else {
				$projects = false;
			}
			return $projects;
		}// end function

		// project_expense_type // --------------------

		public function createProject_expense_type($id, $title, $description) {
			global $con;
			$sql = 'INSERT INTO project_expense_type (id, title, description) VALUES (' . $id . ', ' . $title . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readProject_expense_type($id) {
			global $con;
			$sql = 'SELECT * FROM project_expense_type WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$project_expense_type = new Project_expense_type();
				$project_expense_type->setId($result[0]);
				$project_expense_type->setTitle($result[1]);
				$project_expense_type->setDescription($result[2]);
			} else {
				$project_expense_type = false;
			}
			return $project_expense_type;
		}// end function

		public function updateProject_expense_type($id, $title, $description) {
			global $con;
			$sql = 'UPDATE project_expense_type SET title = ' . $title . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteProject_expense_type($id) {
			global $con;
			$sql = 'DELETE FROM project_expense_type WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listProject_expense_type() {
			global $con;
			$sql = 'SELECT * FROM project_expense_type';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$project_expense_types = array();
				while ($result = mysqli_fetch_array($results)) {
					$project_expense_type = new Project_expense_type();
					$project_expense_type->setId($result[0]);
					$project_expense_type->setTitle($result[1]);
					$project_expense_type->setDescription($result[2]);
					$project_expense_types[] = $project_expense_type;
				}// end while
			} else {
				$project_expense_types = false;
			}
			return $project_expense_types;
		}// end function

		// project_expenses // --------------------

		public function createProject_expenses($id, $project_id, $title, $description, $amount, $when_entered, $who_entered, $when_authorized, $who_authorized, $type_id) {
			global $con;
			$sql = 'INSERT INTO project_expenses (id, project_id, title, description, amount, when_entered, who_entered, when_authorized, who_authorized, type_id) VALUES (' . $id . ', ' . $project_id . ', ' . $title . ', ' . $description . ', ' . $amount . ', ' . $when_entered . ', ' . $who_entered . ', ' . $when_authorized . ', ' . $who_authorized . ', ' . $type_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readProject_expenses($id) {
			global $con;
			$sql = 'SELECT * FROM project_expenses WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$project_expenses = new Project_expenses();
				$project_expenses->setId($result[0]);
				$project_expenses->setProject($this->readProject($result[1]));
				$project_expenses->setTitle($result[2]);
				$project_expenses->setDescription($result[3]);
				$project_expenses->setAmount($result[4]);
				$project_expenses->setWhenEntered($result[5]);
				$project_expenses->setWhoEntered($result[6]);
				$project_expenses->setWhenAuthorized($result[7]);
				$project_expenses->setWhoAuthorized($result[8]);
				$project_expenses->setType($this->readType($result[9]));
			} else {
				$project_expenses = false;
			}
			return $project_expenses;
		}// end function

		public function updateProject_expenses($id, $project_id, $title, $description, $amount, $when_entered, $who_entered, $when_authorized, $who_authorized, $type_id) {
			global $con;
			$sql = 'UPDATE project_expenses SET project_id = ' . $project_id . ', title = ' . $title . ', description = ' . $description . ', amount = ' . $amount . ', when_entered = ' . $when_entered . ', who_entered = ' . $who_entered . ', when_authorized = ' . $when_authorized . ', who_authorized = ' . $who_authorized . ', type_id = ' . $type_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteProject_expenses($id) {
			global $con;
			$sql = 'DELETE FROM project_expenses WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listProject_expenses() {
			global $con;
			$sql = 'SELECT * FROM project_expenses';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$project_expensess = array();
				while ($result = mysqli_fetch_array($results)) {
					$project_expenses = new Project_expenses();
					$project_expenses->setId($result[0]);
					$project_expenses->setProject($this->readProject($result[1]));
					$project_expenses->setTitle($result[2]);
					$project_expenses->setDescription($result[3]);
					$project_expenses->setAmount($result[4]);
					$project_expenses->setWhenEntered($result[5]);
					$project_expenses->setWhoEntered($result[6]);
					$project_expenses->setWhenAuthorized($result[7]);
					$project_expenses->setWhoAuthorized($result[8]);
					$project_expenses->setType($this->readType($result[9]));
					$project_expensess[] = $project_expenses;
				}// end while
			} else {
				$project_expensess = false;
			}
			return $project_expensess;
		}// end function

		// project_status // --------------------

		public function createProject_status($id, $title, $description, $abbreviation) {
			global $con;
			$sql = 'INSERT INTO project_status (id, title, description, abbreviation) VALUES (' . $id . ', ' . $title . ', ' . $description . ', ' . $abbreviation . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readProject_status($id) {
			global $con;
			$sql = 'SELECT * FROM project_status WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$project_status = new Project_status();
				$project_status->setId($result[0]);
				$project_status->setTitle($result[1]);
				$project_status->setDescription($result[2]);
				$project_status->setAbbreviation($result[3]);
			} else {
				$project_status = false;
			}
			return $project_status;
		}// end function

		public function updateProject_status($id, $title, $description, $abbreviation) {
			global $con;
			$sql = 'UPDATE project_status SET title = ' . $title . ', description = ' . $description . ', abbreviation = ' . $abbreviation . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteProject_status($id) {
			global $con;
			$sql = 'DELETE FROM project_status WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listProject_status() {
			global $con;
			$sql = 'SELECT * FROM project_status';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$project_statuss = array();
				while ($result = mysqli_fetch_array($results)) {
					$project_status = new Project_status();
					$project_status->setId($result[0]);
					$project_status->setTitle($result[1]);
					$project_status->setDescription($result[2]);
					$project_status->setAbbreviation($result[3]);
					$project_statuss[] = $project_status;
				}// end while
			} else {
				$project_statuss = false;
			}
			return $project_statuss;
		}// end function

		// project_status_change // --------------------

		public function createProject_status_change($project_id, $status_id, $when_changed, $who_changed) {
			global $con;
			$sql = 'INSERT INTO project_status_change (project_id, status_id, when_changed, who_changed) VALUES (' . $project_id . ', ' . $status_id . ', ' . $when_changed . ', ' . $who_changed . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readProject_status_change($id) {
			global $con;
			$sql = 'SELECT * FROM project_status_change WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$project_status_change = new Project_status_change();
				$project_status_change->setProject($this->readProject($result[0]));
				$project_status_change->setStatus($this->readStatus($result[1]));
				$project_status_change->setWhenChanged($result[2]);
				$project_status_change->setWhoChanged($result[3]);
			} else {
				$project_status_change = false;
			}
			return $project_status_change;
		}// end function

		public function updateProject_status_change($project_id, $status_id, $when_changed, $who_changed) {
			global $con;
			$sql = 'UPDATE project_status_change SET project_id = ' . $project_id . ', status_id = ' . $status_id . ', when_changed = ' . $when_changed . ', who_changed = ' . $who_changed . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteProject_status_change($id) {
			global $con;
			$sql = 'DELETE FROM project_status_change WHERE project_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listProject_status_change() {
			global $con;
			$sql = 'SELECT * FROM project_status_change';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$project_status_changes = array();
				while ($result = mysqli_fetch_array($results)) {
					$project_status_change = new Project_status_change();
					$project_status_change->setProject($this->readProject($result[0]));
					$project_status_change->setStatus($this->readStatus($result[1]));
					$project_status_change->setWhenChanged($result[2]);
					$project_status_change->setWhoChanged($result[3]);
					$project_status_changes[] = $project_status_change;
				}// end while
			} else {
				$project_status_changes = false;
			}
			return $project_status_changes;
		}// end function

		// purpose // --------------------

		public function createPurpose($id, $title) {
			global $con;
			$sql = 'INSERT INTO purpose (id, title) VALUES (' . $id . ', ' . $title . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readPurpose($id) {
			global $con;
			$sql = 'SELECT * FROM purpose WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$purpose = new Purpose();
				$purpose->setId($result[0]);
				$purpose->setTitle($result[1]);
			} else {
				$purpose = false;
			}
			return $purpose;
		}// end function

		public function updatePurpose($id, $title) {
			global $con;
			$sql = 'UPDATE purpose SET title = ' . $title . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deletePurpose($id) {
			global $con;
			$sql = 'DELETE FROM purpose WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listPurpose() {
			global $con;
			$sql = 'SELECT * FROM purpose';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$purposes = array();
				while ($result = mysqli_fetch_array($results)) {
					$purpose = new Purpose();
					$purpose->setId($result[0]);
					$purpose->setTitle($result[1]);
					$purposes[] = $purpose;
				}// end while
			} else {
				$purposes = false;
			}
			return $purposes;
		}// end function

		// recovery_log // --------------------

		public function createRecovery_log($account_id, $date, $time) {
			global $con;
			$sql = 'INSERT INTO recovery_log (account_id, date, time) VALUES (' . $account_id . ', ' . $date . ', ' . $time . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readRecovery_log($id) {
			global $con;
			$sql = 'SELECT * FROM recovery_log WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$recovery_log = new Recovery_log();
				$recovery_log->setAccount($this->readAccount($result[0]));
				$recovery_log->setDate($result[1]);
				$recovery_log->setTime($result[2]);
			} else {
				$recovery_log = false;
			}
			return $recovery_log;
		}// end function

		public function updateRecovery_log($account_id, $date, $time) {
			global $con;
			$sql = 'UPDATE recovery_log SET account_id = ' . $account_id . ', date = ' . $date . ', time = ' . $time . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteRecovery_log($id) {
			global $con;
			$sql = 'DELETE FROM recovery_log WHERE account_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listRecovery_log() {
			global $con;
			$sql = 'SELECT * FROM recovery_log';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$recovery_logs = array();
				while ($result = mysqli_fetch_array($results)) {
					$recovery_log = new Recovery_log();
					$recovery_log->setAccount($this->readAccount($result[0]));
					$recovery_log->setDate($result[1]);
					$recovery_log->setTime($result[2]);
					$recovery_logs[] = $recovery_log;
				}// end while
			} else {
				$recovery_logs = false;
			}
			return $recovery_logs;
		}// end function

		// requirement // --------------------

		public function createRequirement($id, $title, $description, $status_id) {
			global $con;
			$sql = 'INSERT INTO requirement (id, title, description, status_id) VALUES (' . $id . ', ' . $title . ', ' . $description . ', ' . $status_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readRequirement($id) {
			global $con;
			$sql = 'SELECT * FROM requirement WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$requirement = new Requirement();
				$requirement->setId($result[0]);
				$requirement->setTitle($result[1]);
				$requirement->setDescription($result[2]);
				$requirement->setStatus($this->readStatus($result[3]));
			} else {
				$requirement = false;
			}
			return $requirement;
		}// end function

		public function updateRequirement($id, $title, $description, $status_id) {
			global $con;
			$sql = 'UPDATE requirement SET title = ' . $title . ', description = ' . $description . ', status_id = ' . $status_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteRequirement($id) {
			global $con;
			$sql = 'DELETE FROM requirement WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listRequirement() {
			global $con;
			$sql = 'SELECT * FROM requirement';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$requirements = array();
				while ($result = mysqli_fetch_array($results)) {
					$requirement = new Requirement();
					$requirement->setId($result[0]);
					$requirement->setTitle($result[1]);
					$requirement->setDescription($result[2]);
					$requirement->setStatus($this->readStatus($result[3]));
					$requirements[] = $requirement;
				}// end while
			} else {
				$requirements = false;
			}
			return $requirements;
		}// end function

		// schedule // --------------------

		public function createSchedule($schedule_id, $volunteer_id) {
			global $con;
			$sql = 'INSERT INTO schedule (schedule_id, volunteer_id) VALUES (' . $schedule_id . ', ' . $volunteer_id . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readSchedule($id) {
			global $con;
			$sql = 'SELECT * FROM schedule WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$schedule = new Schedule();
				$schedule->setSchedule($this->readSchedule($result[0]));
				$schedule->setVolunteer($this->readVolunteer($result[1]));
			} else {
				$schedule = false;
			}
			return $schedule;
		}// end function

		public function updateSchedule($schedule_id, $volunteer_id) {
			global $con;
			$sql = 'UPDATE schedule SET schedule_id = ' . $schedule_id . ', volunteer_id = ' . $volunteer_id . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteSchedule($id) {
			global $con;
			$sql = 'DELETE FROM schedule WHERE schedule_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listSchedule() {
			global $con;
			$sql = 'SELECT * FROM schedule';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$schedules = array();
				while ($result = mysqli_fetch_array($results)) {
					$schedule = new Schedule();
					$schedule->setSchedule($this->readSchedule($result[0]));
					$schedule->setVolunteer($this->readVolunteer($result[1]));
					$schedules[] = $schedule;
				}// end while
			} else {
				$schedules = false;
			}
			return $schedules;
		}// end function

		// serves_on // --------------------

		public function createServes_on($person_id, $committee_id, $isOfficer) {
			global $con;
			$sql = 'INSERT INTO serves_on (person_id, committee_id, isOfficer) VALUES (' . $person_id . ', ' . $committee_id . ', ' . $isOfficer . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readServes_on($id) {
			global $con;
			$sql = 'SELECT * FROM serves_on WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$serves_on = new Serves_on();
				$serves_on->setPerson($this->readPerson($result[0]));
				$serves_on->setCommittee($this->readCommittee($result[1]));
				$serves_on->setIsOfficer($result[2]);
			} else {
				$serves_on = false;
			}
			return $serves_on;
		}// end function

		public function updateServes_on($person_id, $committee_id, $isOfficer) {
			global $con;
			$sql = 'UPDATE serves_on SET person_id = ' . $person_id . ', committee_id = ' . $committee_id . ', isOfficer = ' . $isOfficer . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteServes_on($id) {
			global $con;
			$sql = 'DELETE FROM serves_on WHERE person_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listServes_on() {
			global $con;
			$sql = 'SELECT * FROM serves_on';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$serves_ons = array();
				while ($result = mysqli_fetch_array($results)) {
					$serves_on = new Serves_on();
					$serves_on->setPerson($this->readPerson($result[0]));
					$serves_on->setCommittee($this->readCommittee($result[1]));
					$serves_on->setIsOfficer($result[2]);
					$serves_ons[] = $serves_on;
				}// end while
			} else {
				$serves_ons = false;
			}
			return $serves_ons;
		}// end function

		// sponsorship // --------------------

		public function createSponsorship($donation_id, $organization_id, $sponsored_id, $sponsored_type) {
			global $con;
			$sql = 'INSERT INTO sponsorship (donation_id, organization_id, sponsored_id, sponsored_type) VALUES (' . $donation_id . ', ' . $organization_id . ', ' . $sponsored_id . ', ' . $sponsored_type . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readSponsorship($id) {
			global $con;
			$sql = 'SELECT * FROM sponsorship WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$sponsorship = new Sponsorship();
				$sponsorship->setDonation($this->readDonation($result[0]));
				$sponsorship->setOrganization($this->readOrganization($result[1]));
				$sponsorship->setSponsored($this->readSponsored($result[2]));
				$sponsorship->setSponsoredType($result[3]);
			} else {
				$sponsorship = false;
			}
			return $sponsorship;
		}// end function

		public function updateSponsorship($donation_id, $organization_id, $sponsored_id, $sponsored_type) {
			global $con;
			$sql = 'UPDATE sponsorship SET donation_id = ' . $donation_id . ', organization_id = ' . $organization_id . ', sponsored_id = ' . $sponsored_id . ', sponsored_type = ' . $sponsored_type . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteSponsorship($id) {
			global $con;
			$sql = 'DELETE FROM sponsorship WHERE donation_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listSponsorship() {
			global $con;
			$sql = 'SELECT * FROM sponsorship';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$sponsorships = array();
				while ($result = mysqli_fetch_array($results)) {
					$sponsorship = new Sponsorship();
					$sponsorship->setDonation($this->readDonation($result[0]));
					$sponsorship->setOrganization($this->readOrganization($result[1]));
					$sponsorship->setSponsored($this->readSponsored($result[2]));
					$sponsorship->setSponsoredType($result[3]);
					$sponsorships[] = $sponsorship;
				}// end while
			} else {
				$sponsorships = false;
			}
			return $sponsorships;
		}// end function

		// state // --------------------

		public function createState($id, $abbreviation, $title) {
			global $con;
			$sql = 'INSERT INTO state (id, abbreviation, title) VALUES (' . $id . ', ' . $abbreviation . ', ' . $title . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readState($id) {
			global $con;
			$sql = 'SELECT * FROM state WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$state = new State();
				$state->setId($result[0]);
				$state->setAbbreviation($result[1]);
				$state->setTitle($result[2]);
			} else {
				$state = false;
			}
			return $state;
		}// end function

		public function updateState($id, $abbreviation, $title) {
			global $con;
			$sql = 'UPDATE state SET abbreviation = ' . $abbreviation . ', title = ' . $title . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteState($id) {
			global $con;
			$sql = 'DELETE FROM state WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listState() {
			global $con;
			$sql = 'SELECT * FROM state';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$states = array();
				while ($result = mysqli_fetch_array($results)) {
					$state = new State();
					$state->setId($result[0]);
					$state->setAbbreviation($result[1]);
					$state->setTitle($result[2]);
					$states[] = $state;
				}// end while
			} else {
				$states = false;
			}
			return $states;
		}// end function

		// sweat_equity // --------------------

		public function createSweat_equity($ho_id, $person_id, $date, $time, $duration, $when_entered, $who_entered, $when_authorized, $who_authorized) {
			global $con;
			$sql = 'INSERT INTO sweat_equity (ho_id, person_id, date, time, duration, when_entered, who_entered, when_authorized, who_authorized) VALUES (' . $ho_id . ', ' . $person_id . ', ' . $date . ', ' . $time . ', ' . $duration . ', ' . $when_entered . ', ' . $who_entered . ', ' . $when_authorized . ', ' . $who_authorized . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readSweat_equity($id) {
			global $con;
			$sql = 'SELECT * FROM sweat_equity WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$sweat_equity = new Sweat_equity();
				$sweat_equity->setHo($this->readHo($result[0]));
				$sweat_equity->setPerson($this->readPerson($result[1]));
				$sweat_equity->setDate($result[2]);
				$sweat_equity->setTime($result[3]);
				$sweat_equity->setDuration($result[4]);
				$sweat_equity->setWhenEntered($result[5]);
				$sweat_equity->setWhoEntered($result[6]);
				$sweat_equity->setWhenAuthorized($result[7]);
				$sweat_equity->setWhoAuthorized($result[8]);
			} else {
				$sweat_equity = false;
			}
			return $sweat_equity;
		}// end function

		public function updateSweat_equity($ho_id, $person_id, $date, $time, $duration, $when_entered, $who_entered, $when_authorized, $who_authorized) {
			global $con;
			$sql = 'UPDATE sweat_equity SET ho_id = ' . $ho_id . ', person_id = ' . $person_id . ', date = ' . $date . ', time = ' . $time . ', duration = ' . $duration . ', when_entered = ' . $when_entered . ', who_entered = ' . $who_entered . ', when_authorized = ' . $when_authorized . ', who_authorized = ' . $who_authorized . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteSweat_equity($id) {
			global $con;
			$sql = 'DELETE FROM sweat_equity WHERE ho_id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listSweat_equity() {
			global $con;
			$sql = 'SELECT * FROM sweat_equity';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$sweat_equitys = array();
				while ($result = mysqli_fetch_array($results)) {
					$sweat_equity = new Sweat_equity();
					$sweat_equity->setHo($this->readHo($result[0]));
					$sweat_equity->setPerson($this->readPerson($result[1]));
					$sweat_equity->setDate($result[2]);
					$sweat_equity->setTime($result[3]);
					$sweat_equity->setDuration($result[4]);
					$sweat_equity->setWhenEntered($result[5]);
					$sweat_equity->setWhoEntered($result[6]);
					$sweat_equity->setWhenAuthorized($result[7]);
					$sweat_equity->setWhoAuthorized($result[8]);
					$sweat_equitys[] = $sweat_equity;
				}// end while
			} else {
				$sweat_equitys = false;
			}
			return $sweat_equitys;
		}// end function

		// tickets // --------------------

		public function createTickets($id, $event_id, $ticket_price) {
			global $con;
			$sql = 'INSERT INTO tickets (id, event_id, ticket_price) VALUES (' . $id . ', ' . $event_id . ', ' . $ticket_price . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readTickets($id) {
			global $con;
			$sql = 'SELECT * FROM tickets WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$tickets = new Tickets();
				$tickets->setId($result[0]);
				$tickets->setEvent($this->readEvent($result[1]));
				$tickets->setTicketPrice($result[2]);
			} else {
				$tickets = false;
			}
			return $tickets;
		}// end function

		public function updateTickets($id, $event_id, $ticket_price) {
			global $con;
			$sql = 'UPDATE tickets SET event_id = ' . $event_id . ', ticket_price = ' . $ticket_price . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteTickets($id) {
			global $con;
			$sql = 'DELETE FROM tickets WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listTickets() {
			global $con;
			$sql = 'SELECT * FROM tickets';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$ticketss = array();
				while ($result = mysqli_fetch_array($results)) {
					$tickets = new Tickets();
					$tickets->setId($result[0]);
					$tickets->setEvent($this->readEvent($result[1]));
					$tickets->setTicketPrice($result[2]);
					$ticketss[] = $tickets;
				}// end while
			} else {
				$ticketss = false;
			}
			return $ticketss;
		}// end function

		// volunteer // --------------------

		public function createVolunteer($id, $consentAge, $consentVideo, $consentWaiver, $consentPhoto, $availDay, $availEve, $availWend) {
			global $con;
			$sql = 'INSERT INTO volunteer (id, consentAge, consentVideo, consentWaiver, consentPhoto, availDay, availEve, availWend) VALUES (' . $id . ', ' . $consentAge . ', ' . $consentVideo . ', ' . $consentWaiver . ', ' . $consentPhoto . ', ' . $availDay . ', ' . $availEve . ', ' . $availWend . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readVolunteer($id) {
			global $con;
			$sql = 'SELECT * FROM volunteer WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$volunteer = new Volunteer();
				$volunteer->setId($result[0]);
				$volunteer->setConsentAge($result[1]);
				$volunteer->setConsentVideo($result[2]);
				$volunteer->setConsentWaiver($result[3]);
				$volunteer->setConsentPhoto($result[4]);
				$volunteer->setAvailDay($result[5]);
				$volunteer->setAvailEve($result[6]);
				$volunteer->setAvailWend($result[7]);
			} else {
				$volunteer = false;
			}
			return $volunteer;
		}// end function

		public function updateVolunteer($id, $consentAge, $consentVideo, $consentWaiver, $consentPhoto, $availDay, $availEve, $availWend) {
			global $con;
			$sql = 'UPDATE volunteer SET consentAge = ' . $consentAge . ', consentVideo = ' . $consentVideo . ', consentWaiver = ' . $consentWaiver . ', consentPhoto = ' . $consentPhoto . ', availDay = ' . $availDay . ', availEve = ' . $availEve . ', availWend = ' . $availWend . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteVolunteer($id) {
			global $con;
			$sql = 'DELETE FROM volunteer WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listVolunteer() {
			global $con;
			$sql = 'SELECT * FROM volunteer';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$volunteers = array();
				while ($result = mysqli_fetch_array($results)) {
					$volunteer = new Volunteer();
					$volunteer->setId($result[0]);
					$volunteer->setConsentAge($result[1]);
					$volunteer->setConsentVideo($result[2]);
					$volunteer->setConsentWaiver($result[3]);
					$volunteer->setConsentPhoto($result[4]);
					$volunteer->setAvailDay($result[5]);
					$volunteer->setAvailEve($result[6]);
					$volunteer->setAvailWend($result[7]);
					$volunteers[] = $volunteer;
				}// end while
			} else {
				$volunteers = false;
			}
			return $volunteers;
		}// end function

		// work // --------------------

		public function createWork($id, $interest_id, $volunteer_id, $work_type, $location_id, $description) {
			global $con;
			$sql = 'INSERT INTO work (id, interest_id, volunteer_id, work_type, location_id, description) VALUES (' . $id . ', ' . $interest_id . ', ' . $volunteer_id . ', ' . $work_type . ', ' . $location_id . ', ' . $description . ');';
			$this->open();
			$result = mysqli_query($con, $sql);
			$id = ($result) ? mysqli_insert_id($con) : $result;
			$this->close();
			return $id;
		}// end function

		public function readWork($id) {
			global $con;
			$sql = 'SELECT * FROM work WHERE id = ' . $id;
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$result = mysqli_fetch_array($results);
				$work = new Work();
				$work->setId($result[0]);
				$work->setInterest($this->readInterest($result[1]));
				$work->setVolunteer($this->readVolunteer($result[2]));
				$work->setWorkType($result[3]);
				$work->setLocation($this->readLocation($result[4]));
				$work->setDescription($result[5]);
			} else {
				$work = false;
			}
			return $work;
		}// end function

		public function updateWork($id, $interest_id, $volunteer_id, $work_type, $location_id, $description) {
			global $con;
			$sql = 'UPDATE work SET interest_id = ' . $interest_id . ', volunteer_id = ' . $volunteer_id . ', work_type = ' . $work_type . ', location_id = ' . $location_id . ', description = ' . $description . ' WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function deleteWork($id) {
			global $con;
			$sql = 'DELETE FROM work WHERE id = ' . $id;
			$this->open();
			$result = mysqli_query($con, $sql);
			$this->close();
			return $result;
		}// end function

		public function listWork() {
			global $con;
			$sql = 'SELECT * FROM work';
			$this->open();
			$results = mysqli_query($con, $sql);
			$this->close();
			if ($results) {
				$works = array();
				while ($result = mysqli_fetch_array($results)) {
					$work = new Work();
					$work->setId($result[0]);
					$work->setInterest($this->readInterest($result[1]));
					$work->setVolunteer($this->readVolunteer($result[2]));
					$work->setWorkType($result[3]);
					$work->setLocation($this->readLocation($result[4]));
					$work->setDescription($result[5]);
					$works[] = $work;
				}// end while
			} else {
				$works = false;
			}
			return $works;
		}// end function

	}// end class

?>
